feat: Implement force sync functionality in settings screen and update initial sync logic
This commit is contained in:
+4
-2
@@ -202,8 +202,9 @@ class _NotesAppState extends State<NotesApp>
|
||||
|
||||
// Start periodic sync
|
||||
_startPeriodicSync();
|
||||
// Run an initial full sync immediately to pull server changes
|
||||
unawaited(_performSync(forceFull: true));
|
||||
// Run an initial sync immediately and let the repository use the
|
||||
// stored lastSyncAt when it exists.
|
||||
unawaited(_performSync());
|
||||
} catch (e) {
|
||||
// If the database file is not a valid SQLite DB (e.g., wrong key or corruption),
|
||||
// reset the local vault so the app doesn't crash. The reset will delete DB files
|
||||
@@ -720,6 +721,7 @@ class _NotesAppState extends State<NotesApp>
|
||||
key: const ValueKey<String>('settings-screen'),
|
||||
onDeleteAllData: _resetLocalVaultData,
|
||||
onBackToHome: _openHome,
|
||||
onForceSync: () => _performSync(forceFull: true),
|
||||
);
|
||||
|
||||
return MaterialApp(
|
||||
|
||||
Reference in New Issue
Block a user