Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update pull to refresh logic to check offline/online (#1404)
Leendert de Borst4fe60134b3f9
diff --git a/apps/mobile-app/app/(tabs)/items/folder/[id].tsx b/apps/mobile-app/app/(tabs)/items/folder/[id].tsxindex 3cbd2dcc9..25dc287a5 100644--- a/apps/mobile-app/app/(tabs)/items/folder/[id].tsx+++ b/apps/mobile-app/app/(tabs)/items/folder/[id].tsx@@ -143,12 +143,7 @@ export default function FolderViewScreen(): React.ReactNode {setRefreshing(true);setIsLoadingItems(true);- if (authContext.isOffline) {- setRefreshing(false);- setIsLoadingItems(false);- return;- }-+ // Always attempt sync, even when offline - this allows recovery when connection is restoredtry {await syncVault({/**@@ -156,6 +151,7 @@ export default function FolderViewScreen(): React.ReactNode {*/onSuccess: async (hasNewVault) => {await loadItems();+ await dbContext.refreshSyncState(); // Clear offline state if we were offlinesetIsLoadingItems(false);setRefreshing(false);setTimeout(() => {@@ -208,7 +204,7 @@ export default function FolderViewScreen(): React.ReactNode {});}}- }, [syncVault, loadItems, setIsLoadingItems, setRefreshing, authContext, router, t]);+ }, [syncVault, loadItems, setIsLoadingItems, setRefreshing, authContext, dbContext, router, t]);useEffect(() => {if (!isAuthenticated || !isDatabaseAvailable) {diff --git a/apps/mobile-app/app/(tabs)/items/index.tsx b/apps/mobile-app/app/(tabs)/items/index.tsxindex 1ed4cc24a..7e118f053 100644--- a/apps/mobile-app/app/(tabs)/items/index.tsx+++ b/apps/mobile-app/app/(tabs)/items/index.tsx@@ -260,12 +260,7 @@ export default function ItemsScreen(): React.ReactNode {setRefreshing(true);setIsLoadingItems(true);- if (authContext.isOffline) {- setRefreshing(false);- setIsLoadingItems(false);- return;- }-+ // Always attempt sync, even when offline - this allows recovery when connection is restoredtry {await syncVault({/**@@ -273,6 +268,7 @@ export default function ItemsScreen(): React.ReactNode {*/onSuccess: async (hasNewVault) => {await loadItems();+ await dbContext.refreshSyncState(); // Clear offline state if we were offlinesetIsLoadingItems(false);setRefreshing(false);setTimeout(() => {@@ -327,7 +323,7 @@ export default function ItemsScreen(): React.ReactNode {});}}- }, [syncVault, loadItems, setIsLoadingItems, setRefreshing, authContext, dbContext, router, t]);+ }, [syncVault, loadItems, setIsLoadingItems, setRefreshing, dbContext, router, t]);useEffect(() => {if (!isAuthenticated || !isDatabaseAvailable) {