Skip to content

Commit

Permalink
fix: Temporarily disable the Atomic Write functionality pending more …
Browse files Browse the repository at this point in the history
…investigation into data loss issues.
  • Loading branch information
valentine195 committed May 1, 2024
1 parent e83b300 commit 97d38bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export default class StatBlockPlugin extends Plugin {
return (await super.loadData()) as StatblockData;
}
async saveData(settings: StatblockData) {
if (this.settings.atomicWrite) {
/* if (this.settings.atomicWrite) {
try {
await this.app.vault.adapter.write(
`${this.manifest.dir}/temp.json`,
Expand All @@ -329,9 +329,9 @@ export default class StatBlockPlugin extends Plugin {
} catch (e) {
super.saveData(settings);
}
} else {
super.saveData(settings);
}
} else { */
super.saveData(settings);
/* } */
}

async saveMonster(monster: Monster, save: boolean = true) {
Expand Down
10 changes: 10 additions & 0 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
normalizePath,
Notice,
PluginSettingTab,
setIcon,
Setting,
TFolder
} from "obsidian";
Expand Down Expand Up @@ -87,6 +88,15 @@ export default class StatblockSettingTab extends PluginSettingTab {
e.createSpan({
text: "This can cause issues sometimes when using sync services."
});
e.createEl("br");
const warning = e.createDiv();
setIcon(warning.createDiv(), "warning");
warning.createSpan({
attr: {
style: "color: var(--text-error)"
},
text: "This setting is currently disabled."
});
})
)
.addToggle((t) =>
Expand Down

0 comments on commit 97d38bc

Please sign in to comment.