Import log instead of using it off of window
This commit is contained in:
parent
8eb0dd3116
commit
65ddf0a9e8
155 changed files with 3654 additions and 3433 deletions
|
@ -11,6 +11,7 @@ import { Blocked } from './storage/Blocked';
|
|||
import { assert } from '../util/assert';
|
||||
import Data from '../sql/Client';
|
||||
import { SignalProtocolStore } from '../SignalProtocolStore';
|
||||
import * as log from '../logging/log';
|
||||
|
||||
export class Storage implements StorageInterface {
|
||||
public readonly user: User;
|
||||
|
@ -60,7 +61,7 @@ export class Storage implements StorageInterface {
|
|||
defaultValue?: V
|
||||
): V | undefined {
|
||||
if (!this.ready) {
|
||||
window.log.warn('Called storage.get before storage is ready. key:', key);
|
||||
log.warn('Called storage.get before storage is ready. key:', key);
|
||||
}
|
||||
|
||||
const item = this.items[key];
|
||||
|
@ -76,7 +77,7 @@ export class Storage implements StorageInterface {
|
|||
value: Access[K]
|
||||
): Promise<void> {
|
||||
if (!this.ready) {
|
||||
window.log.warn('Called storage.put before storage is ready. key:', key);
|
||||
log.warn('Called storage.put before storage is ready. key:', key);
|
||||
}
|
||||
|
||||
this.items[key] = value;
|
||||
|
@ -87,10 +88,7 @@ export class Storage implements StorageInterface {
|
|||
|
||||
public async remove<K extends keyof Access>(key: K): Promise<void> {
|
||||
if (!this.ready) {
|
||||
window.log.warn(
|
||||
'Called storage.remove before storage is ready. key:',
|
||||
key
|
||||
);
|
||||
log.warn('Called storage.remove before storage is ready. key:', key);
|
||||
}
|
||||
|
||||
delete this.items[key];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue