Handling every location type

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2020-10-02 13:21:25 +03:00
1 parent 700fc5745b
commit 1189c9f562
1 file changed
+4 -1
+4 -1
View File
@@ -18,8 +18,11 @@ if (ipcRenderer) {
}
export function navigate(location: LocationDescriptor) {
if (history.location.pathname === location) return;
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 = {}> {