Skip to content

Commit

Permalink
fix: wrap file delete in try catch
Browse files Browse the repository at this point in the history
This would potentially fix the reload prompt not appearing every time the switch is toggled.
  • Loading branch information
Palm authored Mar 18, 2024
1 parent 30c5535 commit 7c17223
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/storage/backends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ export const removeCachedScript = async () => {
// TODO: Fix this BS
const fs = RN.NativeModules.RNFSManager;

await fs.unlink(
(await FileManager.fileExists(`${scriptDir}/revenge.js`))
? `${scriptDir}/revenge.js`
: `${scriptDir}/vendetta.js`
);
try {
await fs.unlink(
(await FileManager.fileExists(`${scriptDir}/revenge.js`))
? `${scriptDir}/revenge.js`
: `${scriptDir}/vendetta.js`
);
} catch {}
};

export const purgeStorage = async (store: string) => {
Expand Down

0 comments on commit 7c17223

Please sign in to comment.