Use SignalContext instead of SignalWindow

This commit is contained in:
Josh Perez 2021-10-07 19:28:47 -04:00 committed by GitHub
parent a70a8a88d6
commit 75dab30367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 180 additions and 231 deletions

View file

@ -58,7 +58,7 @@ exports.createConversation = async ({
await Promise.all(
range(0, numMessages).map(async index => {
await sleep(index * 100);
window.SignalWindow.log.info(`Create message ${index + 1}`);
window.SignalContext.log.info(`Create message ${index + 1}`);
const message = await createRandomMessage({ conversationId });
return Signal.Data.saveMessage(message);
})
@ -110,7 +110,7 @@ const createRandomMessage = async ({ conversationId } = {}) => {
const message = _createMessage({ commonProperties, conversationId, type });
return Message.initializeSchemaVersion({
message,
logger: window.SignalWindow.log,
logger: window.SignalContext.log,
});
};

View file

@ -16,7 +16,7 @@ class IdleDetector extends EventEmitter {
}
start() {
window.SignalWindow.log.info('Start idle detector');
window.SignalContext.log.info('Start idle detector');
this._scheduleNextCallback();
}
@ -25,7 +25,7 @@ class IdleDetector extends EventEmitter {
return;
}
window.SignalWindow.log.info('Stop idle detector');
window.SignalContext.log.info('Stop idle detector');
this._clearScheduledCallbacks();
}

View file

@ -12,7 +12,7 @@ module.exports = {
};
async function doesDatabaseExist() {
window.SignalWindow.log.info(
window.SignalContext.log.info(
'Checking for the existence of IndexedDB data...'
);
return new Promise((resolve, reject) => {
@ -22,7 +22,7 @@ async function doesDatabaseExist() {
let existed = true;
setTimeout(() => {
window.SignalWindow.log.warn(
window.SignalContext.log.warn(
'doesDatabaseExist: Timed out attempting to check IndexedDB status'
);
return resolve(false);
@ -43,7 +43,7 @@ async function doesDatabaseExist() {
}
function removeDatabase() {
window.SignalWindow.log.info(
window.SignalContext.log.info(
`Deleting IndexedDB database '${Whisper.Database.id}'`
);
window.indexedDB.deleteDatabase(Whisper.Database.id);

View file

@ -45,7 +45,7 @@ exports.processNext = async ({
}
);
} catch (error) {
window.SignalWindow.log.error(
window.SignalContext.log.error(
'processNext error:',
error && error.stack ? error.stack : error
);