Show loading state when deleting a credential (#771)

This commit is contained in:
Leendert de Borst
2025-05-05 09:02:46 +02:00
parent 5743056084
commit af53abac0b

View File

@@ -370,6 +370,8 @@ export default function AddEditCredentialScreen() : React.ReactNode {
* Delete the credential.
*/
onPress: async () : Promise<void> => {
setIsLoading(true);
await executeVaultMutation(async () => {
await dbContext.sqliteClient!.deleteCredentialById(id);
});
@@ -383,6 +385,8 @@ export default function AddEditCredentialScreen() : React.ReactNode {
});
}, 200);
setIsLoading(false);
/*
* Hard navigate back to the credentials list as the credential that was
* shown in the previous screen is now deleted.