Skip to content

Commit 69c9624

Browse files
committed
fix: go back a page when deleting the last page
Fixes #98
1 parent 724f59b commit 69c9624

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/me/chrr/scribble/screen/ScribbleBookEditScreen.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ public void insertPageAt(int page, @Nullable RichText content) {
505505
public void deletePage(int page) {
506506
this.pages.remove(page);
507507
this.dirty = true;
508+
509+
if (page >= this.pages.size() - 1)
510+
this.showPage(page - 1, false);
508511
this.updateCurrentPages();
509512
}
510513
//endregion

0 commit comments

Comments
 (0)