Remove unneeded function

This commit is contained in:
2026-02-06 15:14:43 +01:00
parent d94e9eeb3d
commit 181e853790

View File

@@ -63,9 +63,8 @@ class _SheetViewerPageState extends State<SheetViewerPage>
@override
void dispose() {
// Save current annotations synchronously before disposing
// Note: This is fire-and-forget, but Hive operations are fast enough
_saveCurrentAnnotationsSync();
// Make sure annotations are saved before exiting
_saveCurrentAnnotations();
_leftDrawingController.dispose();
_rightDrawingController.dispose();
@@ -74,27 +73,6 @@ class _SheetViewerPageState extends State<SheetViewerPage>
super.dispose();
}
/// Synchronous version that doesn't await - used in dispose
void _saveCurrentAnnotationsSync() {
// Save left page (always, since paint mode is single-page only)
final leftJson = _leftDrawingController.toJsonString();
_storageService.writeAnnotations(
widget.sheet.uuid,
_currentPage,
leftJson.isEmpty || leftJson == '[]' ? null : leftJson,
);
// Save right page if in two-page mode
if (widget.config.twoPageMode && _currentPage < _totalPages) {
final rightJson = _rightDrawingController.toJsonString();
_storageService.writeAnnotations(
widget.sheet.uuid,
_currentPage + 1,
rightJson.isEmpty || rightJson == '[]' ? null : rightJson,
);
}
}
// ---------------------------------------------------------------------------
// PDF Loading
// ---------------------------------------------------------------------------