Use different z-index for app-loading-screen

This commit is contained in:
Fedor Indutny 2021-12-04 00:04:34 +01:00 committed by GitHub
parent 874a019227
commit e46a1979c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 64 additions and 26 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2018-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
/* global window, Whisper, setTimeout */
/* global window, Whisper, clearTimeout, setTimeout */
const MESSAGE_MINIMUM_VERSION = 7;
@ -21,15 +21,26 @@ async function doesDatabaseExist() {
let existed = true;
setTimeout(() => {
let timer = setTimeout(() => {
window.SignalContext.log.warn(
'doesDatabaseExist: Timed out attempting to check IndexedDB status'
);
return resolve(false);
}, 1000);
req.onerror = reject;
const clearTimer = () => {
if (timer !== undefined) {
clearTimeout(timer);
timer = undefined;
}
};
req.onerror = error => {
clearTimer();
reject(error);
};
req.onsuccess = () => {
clearTimer();
req.result.close();
resolve(existed);
};