mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
reimplemented l10n using dynamic import() (#1012)
this should greatly reduce the complexity of the l10n code and build pipeline and eliminate the most common error seen in sentry logs (no translate function)
This commit is contained in:
committed by
Donovan Preston
parent
5afa4e5c9b
commit
1e62aa976d
@@ -52,9 +52,9 @@ function checkStreams() {
|
||||
}
|
||||
}
|
||||
|
||||
function polyfillStreams() {
|
||||
async function polyfillStreams() {
|
||||
try {
|
||||
require('@mattiasbuelens/web-streams-polyfill');
|
||||
await import('@mattiasbuelens/web-streams-polyfill');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
@@ -64,7 +64,10 @@ function polyfillStreams() {
|
||||
export default async function capabilities() {
|
||||
const crypto = await checkCrypto();
|
||||
const nativeStreams = checkStreams();
|
||||
const polyStreams = nativeStreams ? false : polyfillStreams();
|
||||
let polyStreams = false;
|
||||
if (!nativeStreams) {
|
||||
polyStreams = await polyfillStreams();
|
||||
}
|
||||
let account = typeof AUTH_CONFIG !== 'undefined';
|
||||
try {
|
||||
account = account && !!localStorage;
|
||||
|
||||
Reference in New Issue
Block a user