Skip to content

Commit

Permalink
fix: localStorage is not available in a worker.
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Jun 19, 2024
1 parent 5fba0e6 commit 29d3e14
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tmpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ let bindedUnloadEvt = false;

// 'export' is for ease of testing
export async function delMarkFiles() {
if (self.localStorage == null) return;

const opfsToolsExpires = 'OPFS_TOOLS_EXPIRES_TMP_FILES';

if (!bindedUnloadEvt) {
Expand Down

0 comments on commit 29d3e14

Please sign in to comment.