Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tiling-assistant@leleat-on-github/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ export default class TilingAssistantExtension extends Extension {
try {
parent.make_directory_with_parents(null);
} catch (e) {
logError(e);
if (e.code !== Gio.IOErrorEnum.EXISTS) {
throw e;
}
}

const path = GLib.build_filenamev([parentPath, '/tiledSessionRestore.json']);
Expand All @@ -314,7 +316,9 @@ export default class TilingAssistantExtension extends Extension {
try {
file.create(Gio.FileCreateFlags.NONE, null);
} catch (e) {
logError(e);
if (e.code !== Gio.IOErrorEnum.EXISTS) {
throw e;
}
}

file.replace_contents(JSON.stringify(saveObj), null, false,
Expand All @@ -340,7 +344,9 @@ export default class TilingAssistantExtension extends Extension {
try {
file.create(Gio.FileCreateFlags.NONE, null);
} catch (e) {
logError(e);
if (e.code !== Gio.IOErrorEnum.EXISTS) {
throw e;
}
}

const [success, contents] = file.load_contents(null);
Expand Down
8 changes: 6 additions & 2 deletions tiling-assistant@leleat-on-github/src/prefs/layoutsPrefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ export default class {
try {
parentDir.make_directory_with_parents(null);
} catch (e) {
logError(e);
if (e.code !== Gio.IOErrorEnum.EXISTS) {
throw e;
}
}

// Create file, if it doesn't exist.
Expand All @@ -180,7 +182,9 @@ export default class {
try {
file.create(Gio.FileCreateFlags.NONE, null);
} catch (e) {
logError(e);
if (e.code !== Gio.IOErrorEnum.EXISTS) {
throw e;
}
}

return file;
Expand Down