1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Handling every location type

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2020-10-02 13:21:25 +03:00
parent 700fc5745b
commit 1189c9f562

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 = {}> {