From 39e658a4881ba89c2619788ccd57f1d37dbc2750 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 22 Aug 2022 13:04:57 +0200 Subject: [PATCH] Fix building --- src/lib/appManagers/appDialogsManager.ts | 6 +++--- src/lib/localStorage.ts | 6 +++--- src/lib/storage.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/appManagers/appDialogsManager.ts b/src/lib/appManagers/appDialogsManager.ts index ec7731b9..58193df7 100644 --- a/src/lib/appManagers/appDialogsManager.ts +++ b/src/lib/appManagers/appDialogsManager.ts @@ -111,7 +111,7 @@ interface SortedDialog extends SortedElementBase { } function setPromiseMiddleware}, K extends keyof T>(obj: T, key: K) { - const oldPromise = obj[key]; + const oldPromise: CancellablePromise = obj[key] as any; if(oldPromise) { oldPromise.reject(); } @@ -119,12 +119,12 @@ function setPromiseMiddleware(); deferred.catch(() => {}).finally(() => { - if(obj[key] === deferred) { + if((obj[key] as any) === deferred) { delete obj[key]; } }); - const middleware = middlewarePromise(() => obj[key] === deferred); + const middleware = middlewarePromise(() => (obj[key] as any) === deferred); return {deferred, middleware}; } diff --git a/src/lib/localStorage.ts b/src/lib/localStorage.ts index f3746797..7fd2da36 100644 --- a/src/lib/localStorage.ts +++ b/src/lib/localStorage.ts @@ -32,7 +32,7 @@ class LocalStorage> { } else if(this.useStorage) { let value: Storage[T]; try { - value = localStorage.getItem(this.prefix + key as string) as any; + value = localStorage.getItem(this.prefix + (key as string)) as any; } catch(err) { this.useStorage = false; } @@ -73,7 +73,7 @@ class LocalStorage> { public delete(key: keyof Storage, saveLocal = false) { // ! it is needed here - key = '' + key; + key = '' + (key as string); if(!saveLocal) { delete this.cache[key]; @@ -81,7 +81,7 @@ class LocalStorage> { // if(this.useStorage) { try { - localStorage.removeItem(this.prefix + key); + localStorage.removeItem(this.prefix + (key as string)); } catch(err) { } diff --git a/src/lib/storage.ts b/src/lib/storage.ts index 344f2168..b6dfbc50 100644 --- a/src/lib/storage.ts +++ b/src/lib/storage.ts @@ -268,7 +268,7 @@ export default class AppStorage< } */ // ! it is needed here - key = '' + key; + key = '' + (key as string); if(!saveLocal) { delete this.cache[key];