Use SignalContext instead of SignalWindow
This commit is contained in:
parent
a70a8a88d6
commit
75dab30367
35 changed files with 180 additions and 231 deletions
|
@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue