mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-14 10:25:14 -04:00
Prevent double sync when opening popup (#957)
This commit is contained in:
committed by
Leendert de Borst
parent
afe2ba52b5
commit
b53a4334ca
@@ -88,8 +88,7 @@ const CredentialsList: React.FC = () => {
|
||||
setIsLoading(true);
|
||||
await onRefresh();
|
||||
setIsLoading(false);
|
||||
setIsInitialLoading(false);
|
||||
}, [onRefresh, setIsLoading, setIsInitialLoading]);
|
||||
}, [onRefresh, setIsLoading]);
|
||||
|
||||
// Set header buttons on mount and clear on unmount
|
||||
useEffect((): (() => void) => {
|
||||
@@ -127,16 +126,12 @@ const CredentialsList: React.FC = () => {
|
||||
const results = dbContext.sqliteClient?.getAllCredentials() ?? [];
|
||||
setCredentials(results);
|
||||
setIsLoading(false);
|
||||
setIsInitialLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
refreshCredentials();
|
||||
}, [dbContext?.sqliteClient, setIsLoading]);
|
||||
|
||||
// Call syncVaultAndRefresh when the page first mounts
|
||||
useEffect(() => {
|
||||
syncVaultAndRefresh();
|
||||
}, [syncVaultAndRefresh]);
|
||||
}, [dbContext?.sqliteClient, setIsLoading, setIsInitialLoading]);
|
||||
|
||||
// Add this function to filter credentials
|
||||
const filteredCredentials = credentials.filter(cred => {
|
||||
|
||||
@@ -117,7 +117,6 @@ const Reinitialize: React.FC = () => {
|
||||
navigate('/unlock-success', { replace: true });
|
||||
} else {
|
||||
await restoreLastPage();
|
||||
setIsInitialLoading(false);
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user