Skip to content

Commit

Permalink
[MS] Fix page resetting during animation after export recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Ironicbay committed Jan 16, 2024
1 parent 21320b0 commit 2c4fe79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
10 changes: 2 additions & 8 deletions client/src/components/header/HeaderBackButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="back-button-container">
<ion-button
fill="clear"
@click="goBack()"
@click="routerGoBack()"
class="back-button"
>
<ion-icon :icon="chevronBack" />
Expand All @@ -25,19 +25,13 @@
</template>

<script setup lang="ts">
import { routerGoBack } from '@/router';
import { IonButton, IonIcon, IonLabel } from '@ionic/vue';
import { chevronBack } from 'ionicons/icons';
import { useRouter } from 'vue-router';

defineProps<{
short: boolean;
}>();

const router = useRouter();

function goBack(): void {
router.go(-1);
}
</script>

<style scoped lang="scss">
Expand Down
4 changes: 4 additions & 0 deletions client/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ export function routerNavigateToWorkspace(workspaceId: WorkspaceID, path = '/'):
}
});
}

export function routerGoBack(): void {
router.go(-1);
}
12 changes: 2 additions & 10 deletions client/src/views/devices/ExportRecoveryDevicePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<ion-button
class="return-btn button-outline"
fill="outline"
@click="onBackToDevicesClick()"
@click="routerGoBack()"
id="back-to-devices-button"
>
<ion-icon
Expand All @@ -153,7 +153,7 @@
import { MsInformativeText, getPasswordFromUser } from '@/components/core';
import { RecoveryDeviceErrorTag, exportRecoveryDevice } from '@/parsec';
import { getClientInfo } from '@/parsec/login';
import { routerNavigateTo } from '@/router';
import { routerGoBack } from '@/router';
import { Notification, NotificationKey, NotificationLevel, NotificationManager } from '@/services/notificationManager';
import { translate } from '@/services/translation';
import { IonButton, IonContent, IonIcon, IonPage, IonText } from '@ionic/vue';
Expand Down Expand Up @@ -243,14 +243,6 @@ async function fileDownload(data: string, fileName: string): Promise<void> {
downloadLink.value.setAttribute('download', fileName);
downloadLink.value.click();
}

// Placeholder page reset causing visual flickering
function onBackToDevicesClick(): void {
recoveryFileDownloaded.value = false;
recoveryKeyDownloaded.value = false;
state.value = ExportDevicePageState.Start;
routerNavigateTo('devices');
}
</script>

<style scoped lang="scss">
Expand Down

0 comments on commit 2c4fe79

Please sign in to comment.