Skip to content

Commit f462b79

Browse files
committed
Remove disconnected observers
1 parent 0b91105 commit f462b79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contexts/fileSystem/functions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const addFileSystemHandle = async (
5656
},
5757
FS_HANDLES
5858
);
59+
5960
if (observer) observers.set(dirPath, observer);
6061
} catch {
6162
// Ignore errors storing handle
@@ -73,7 +74,9 @@ export const removeFileSystemHandle = async (
7374

7475
try {
7576
await db.put(KEYVAL_STORE_NAME, handles, FS_HANDLES);
77+
7678
observers.get(directory)?.disconnect();
79+
observers.delete(directory);
7780
} catch {
7881
// Ignore errors storing handle
7982
}

0 commit comments

Comments
 (0)