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

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 2020-10-02 14:33:29 +03:00 committed by GitHub
parent 68317453c1
commit 14d3d88278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,11 @@ if (ipcRenderer) {
} }
export function navigate(location: LocationDescriptor) { export function navigate(location: LocationDescriptor) {
const currentLocation = navigation.getPath();
navigation.push(location); navigation.push(location);
if (currentLocation === navigation.getPath()) {
navigation.goBack(); // prevent sequences of same url in history
}
} }
export interface IURLParams<P = {}, Q = {}> { export interface IURLParams<P = {}, Q = {}> {