Fix: check for location bevore navigate (#1016)

* Check for location before navigate

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Handling every location type

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2020-10-02 14:33:29 +03:00
1 parent 68317453c1
commit 14d3d88278
1 file changed
+4
+4
View File
@@ -18,7 +18,11 @@ if (ipcRenderer) {
}
export function navigate(location: LocationDescriptor) {
const currentLocation = navigation.getPath();
navigation.push(location);
if (currentLocation === navigation.getPath()) {
navigation.goBack(); // prevent sequences of same url in history
}
}
export interface IURLParams<P = {}, Q = {}> {