Skip to content

Commit

Permalink
Set loading screen in VaultDetails during fetching recover state
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal committed Nov 13, 2023
1 parent 1f7d004 commit 3797335
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/components/VaultDetails.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div v-if="vault == null">
<div v-if="vault == null || vaultRecoveryRequired == null">
<div v-if="onFetchError == null">
{{ t('common.loading') }}
</div>
Expand Down Expand Up @@ -239,7 +239,7 @@ const claimVaultOwnershipDialog = ref<typeof ClaimVaultOwnershipDialog>();
const claimingVaultOwnership = ref(false);
const me = ref<UserDto>();
const vaultRecoveryRequired = ref(false);
const vaultRecoveryRequired = ref<boolean | null>(null);
onMounted(fetchData);
Expand All @@ -250,6 +250,8 @@ async function fetchData() {
me.value = await backend.users.me(true);
if (props.role == 'OWNER') {
await fetchOwnerData();
} else {
vaultRecoveryRequired.value = false;
}
} catch (error) {
console.error('Fetching data failed.', error);
Expand All @@ -263,6 +265,7 @@ async function fetchOwnerData() {
vaultKeys.value = await loadVaultKeys(vaultKeyJwe);
(await backend.vaults.getMembers(props.vaultId)).forEach(member => members.value.set(member.id, member));
usersRequiringAccessGrant.value = await backend.vaults.getUsersRequiringAccessGrant(props.vaultId);
vaultRecoveryRequired.value = false;
} catch(error) {
if (error instanceof ForbiddenError) {
vaultRecoveryRequired.value = true;
Expand Down

0 comments on commit 3797335

Please sign in to comment.