Skip to content

Commit 227474c

Browse files
committed
Fix storage path ending replacement
1 parent bc076ca commit 227474c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/vscode/src/fill/storageDatabase.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ class StorageDatabase implements workspaceStorage.IStorageDatabase {
1414
public readonly onDidChangeItemsExternal = Event.None;
1515
private readonly items = new Map<string, string>();
1616
private fetched: boolean = false;
17+
private readonly path: string;
1718

18-
public constructor(private readonly path: string) {
19-
path = path.replace(/\.vscdb$/, ".json");
20-
logger.debug("Setting up storage", field("path", path));
19+
public constructor(path: string) {
20+
this.path = path.replace(/\.vscdb$/, ".json");
21+
logger.debug("Setting up storage", field("path", this.path));
2122
window.addEventListener("unload", () => {
2223
if (!navigator.sendBeacon) {
2324
throw new Error("cannot save state");
@@ -39,7 +40,7 @@ class StorageDatabase implements workspaceStorage.IStorageDatabase {
3940
this.items.set(key, json[key]);
4041
});
4142
} catch (error) {
42-
if (error.code && error.code !== "ENOENT") {
43+
if (error.code !== "ENOENT") {
4344
throw error;
4445
}
4546
}

0 commit comments

Comments
 (0)