Fix building
This commit is contained in:
parent
03dc3f34b0
commit
39e658a488
@ -111,7 +111,7 @@ interface SortedDialog extends SortedElementBase {
|
||||
}
|
||||
|
||||
function setPromiseMiddleware<T extends {[smth in K as K]?: CancellablePromise<void>}, K extends keyof T>(obj: T, key: K) {
|
||||
const oldPromise = obj[key];
|
||||
const oldPromise: CancellablePromise<void> = obj[key] as any;
|
||||
if(oldPromise) {
|
||||
oldPromise.reject();
|
||||
}
|
||||
@ -119,12 +119,12 @@ function setPromiseMiddleware<T extends {[smth in K as K]?: CancellablePromise<v
|
||||
// @ts-ignore
|
||||
const deferred = obj[key] = deferredPromise<void>();
|
||||
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};
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class LocalStorage<Storage extends Record<string, any>> {
|
||||
} 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<Storage extends Record<string, any>> {
|
||||
|
||||
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<Storage extends Record<string, any>> {
|
||||
|
||||
// if(this.useStorage) {
|
||||
try {
|
||||
localStorage.removeItem(this.prefix + key);
|
||||
localStorage.removeItem(this.prefix + (key as string));
|
||||
} catch(err) {
|
||||
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ export default class AppStorage<
|
||||
} */
|
||||
|
||||
// ! it is needed here
|
||||
key = '' + key;
|
||||
key = '' + (key as string);
|
||||
|
||||
if(!saveLocal) {
|
||||
delete this.cache[key];
|
||||
|
Loading…
Reference in New Issue
Block a user