Skip to content

Commit

Permalink
fix: total card number must be greater than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
sosuisen committed Dec 27, 2023
1 parent 59bbbee commit aceda29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,13 @@ function App() {
// Remove empty page
logger.debug(`Empty page: ${originalName}`);
db.box.delete([currentGraph, originalName]).then(() => {
setTotalCardNumber(num => num - 1);
setTotalCardNumber(num => num > 0 ? num - 1 : 0);
});
}
}
else if (operation === 'delete') {
db.box.delete([currentGraph, originalName]).then(() => {
setTotalCardNumber(num => num - 1);
setTotalCardNumber(num => num > 0 ? num - 1 : 0);
});
}
else {
Expand Down

0 comments on commit aceda29

Please sign in to comment.