Skip to content

Commit

Permalink
fix: Fixes issue where importing the same layout twice and deleting o…
Browse files Browse the repository at this point in the history
…ne would delete both
  • Loading branch information
valentine195 committed Mar 13, 2024
1 parent c7ea4ee commit 9c189eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,7 @@ export default class StatblockSettingTab extends PluginSettingTab {
);
return;
}
if (!layout?.id) {
layout.id = nanoid();
}

if (!layout?.blocks) {
reject(
new Error(
Expand All @@ -415,6 +413,9 @@ export default class StatblockSettingTab extends PluginSettingTab {
if (!layout.diceParsing) {
layout.diceParsing = [];
}

layout.id = nanoid();

if (
!this.plugin.settings.alwaysImport &&
layout.blocks.find(
Expand Down

0 comments on commit 9c189eb

Please sign in to comment.