summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/lib
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-03-15 10:50:10 +0100
committerOskar Nyberg <oskar@mullvad.net>2021-03-16 11:53:54 +0100
commitfb01e23b20587f38dca80072b71d2cded0249303 (patch)
treec60264342d6de52e47749ffb12fb582bc8ead15b /gui/src/renderer/lib
parent441c7ea1b6ef83459b80c088a593997aad84c7ad (diff)
downloadmullvadvpn-fb01e23b20587f38dca80072b71d2cded0249303.tar.xz
mullvadvpn-fb01e23b20587f38dca80072b71d2cded0249303.zip
Fix not setting account when not connected to daemon
Diffstat (limited to 'gui/src/renderer/lib')
-rw-r--r--gui/src/renderer/lib/history.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/gui/src/renderer/lib/history.ts b/gui/src/renderer/lib/history.ts
index 68553f77c7..3f98508ce1 100644
--- a/gui/src/renderer/lib/history.ts
+++ b/gui/src/renderer/lib/history.ts
@@ -80,6 +80,13 @@ export default class History {
this.notify(affectedEntries);
};
+ public resetWithIfDifferent = (nextLocation: LocationDescriptor<S>, nextState?: S) => {
+ const location = this.createLocation(nextLocation, nextState);
+ if (this.entries[0].pathname !== location.pathname) {
+ this.resetWith(nextLocation, nextState);
+ }
+ };
+
public canGo(n: number) {
const nextIndex = this.index + n;
return nextIndex >= 0 && nextIndex < this.entries.length;