Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e69b03d

Browse files
committed
move local storage lookup later
Signed-off-by: shmck <[email protected]>
1 parent 445abf5 commit e69b03d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/storage/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class Storage<T> {
3030
this.defaultValue = defaultValue
3131
}
3232
public get = async (): Promise<T> => {
33-
const value: string | undefined = await this.storage.get(this.key)
3433
if (SESSION_STORAGE_PATH) {
3534
try {
3635
// 1. read from file instead of local storage if specified
@@ -51,6 +50,7 @@ class Storage<T> {
5150
console.warn(`Failed to read or parse session file: ${SESSION_STORAGE_PATH}/${this.filePath}.json`)
5251
}
5352
}
53+
const value: string | undefined = await this.storage.get(this.key)
5454
if (value) {
5555
// 2. read from local storage
5656
try {

0 commit comments

Comments
 (0)