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:
parent
68317453c1
commit
14d3d88278
@ -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 = {}> {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user