Skip to content

Commit 8a9420a

Browse files
committed
fix: don't save state of SAFMode="single" files
Files opened with `SAFMode="single"` are accessed via a SAF intent, which provides only temporary access to their URIs. Saving the state for these files can cause issues on the next app startup, as the temporary access is revoked and the app will be unable to access the file again. This change prevents saving the state for such files, avoiding potential errors and other related issues.
1 parent 51f0fbe commit 8a9420a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib/saveState.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default () => {
1313
files.forEach((file) => {
1414
if (file.type !== "editor") return;
1515
if (file.id === constants.DEFAULT_FILE_SESSION) return;
16+
if (file.SAFMode === "single") return;
1617

1718
const fileJson = {
1819
id: file.id,

0 commit comments

Comments
 (0)