Skip to content

Commit

Permalink
Allow to optionally overwrite existing boards on import
Browse files Browse the repository at this point in the history
  • Loading branch information
gf-mse committed Aug 5, 2022
1 parent 4652568 commit 982e263
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nullboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -3454,7 +3454,7 @@ <h3>Auto-backup</h3>
return "Required board properties are empty.";

if (foo.format != NB.blobVersion)
return `Unsupported blob format "${board.format}", expecting "${NB.blobVersion}".`;
return `Unsupported blob format "${foo.format}", expecting "${NB.blobVersion}".`;

return null;
}
Expand Down Expand Up @@ -3507,8 +3507,11 @@ <h3>Auto-backup</h3>

if (index.has(board.id))
{
console.log(`Import: board ${board.id} (${board.title}) will be assigned new ID`);
board.id = +new Date();
msg = `Import: shall board ${board.id} (${board.title}) be assigned a new ID (Cancel=No/overwrite existing/)?`
if (confirm(msg)) {
console.log(`Import: board ${board.id} (${board.title}) will be assigned new ID`);
board.id = +new Date();
}
}

board.revision--; // save will ++ it back
Expand Down

0 comments on commit 982e263

Please sign in to comment.