summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--desktop/packages/mullvad-vpn/src/renderer/app.tsx4
-rw-r--r--desktop/packages/mullvad-vpn/src/renderer/lib/transition-hooks.ts14
2 files changed, 10 insertions, 8 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/app.tsx b/desktop/packages/mullvad-vpn/src/renderer/app.tsx
index 85e6d80687..120d2d8ce5 100644
--- a/desktop/packages/mullvad-vpn/src/renderer/app.tsx
+++ b/desktop/packages/mullvad-vpn/src/renderer/app.tsx
@@ -681,10 +681,6 @@ export default class AppRenderer {
public setNavigationHistory(history: IHistoryObject) {
IpcRendererEventChannel.navigation.setHistory(history);
-
- if (window.env.e2e) {
- window.e2e.location = history.entries[history.index].pathname;
- }
}
// If the installer has just been downloaded and verified we want to automatically
diff --git a/desktop/packages/mullvad-vpn/src/renderer/lib/transition-hooks.ts b/desktop/packages/mullvad-vpn/src/renderer/lib/transition-hooks.ts
index cf8dad0e6e..35396459b5 100644
--- a/desktop/packages/mullvad-vpn/src/renderer/lib/transition-hooks.ts
+++ b/desktop/packages/mullvad-vpn/src/renderer/lib/transition-hooks.ts
@@ -32,17 +32,22 @@ export function useViewTransitions(onTransition?: () => void): Location<Location
const queuedLocationRef = useRef<QueueItem>(undefined);
const { setNavigationHistory } = useAppContext();
- const reduceMotion = getReduceMotion();
-
const updateView = useEffectEvent((location: Location<LocationState>) => {
- setNavigationHistory(history.asObject);
setCurrentLocation(location);
+ setNavigationHistory(history.asObject);
+ });
+
+ const onTransitionEnd = useEffectEvent((location: Location<LocationState>) => {
+ if (window.env.e2e) {
+ window.e2e.location = location.pathname;
+ }
});
const transitionToView = useEffectEvent(
(location: Location<LocationState>, transition: TransitionType) => {
- if (reduceMotion) {
+ if (getReduceMotion()) {
updateView(location);
+ setTimeout(() => onTransitionEnd(location));
return;
}
@@ -61,6 +66,7 @@ export function useViewTransitions(onTransition?: () => void): Location<Location
transitionToView(queueLocation.location, queueLocation.transition);
} else {
onTransition?.();
+ onTransitionEnd?.(location);
}
});
},