mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 20:03:25 +01:00
Import log instead of using it off of window
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user