mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Unified History: Going to a dashboard page creates two history entries (#98333)
This commit is contained in:
parent
6c1cce407a
commit
7660fa3921
@ -145,13 +145,17 @@ export class AppChromeService {
|
||||
return entries;
|
||||
}
|
||||
|
||||
let lastEntry = entries[0];
|
||||
if (!lastEntry || lastEntry.name !== newPageNav.text) {
|
||||
lastEntry = { name: newPageNav.text, views: [], breadcrumbs, time: Date.now(), url: window.location.href };
|
||||
}
|
||||
if (lastEntry !== entries[0]) {
|
||||
entries = [lastEntry, ...entries];
|
||||
const lastEntry = entries[0];
|
||||
const newEntry = { name: newPageNav.text, views: [], breadcrumbs, time: Date.now(), url: window.location.href };
|
||||
const isSameUrl = lastEntry && newEntry.url === lastEntry.url;
|
||||
|
||||
// To avoid adding an entry with the same url twice, we always use the latest one
|
||||
if (isSameUrl) {
|
||||
entries[0] = newEntry;
|
||||
} else {
|
||||
entries = [newEntry, ...entries];
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
private ignoreStateUpdate(newState: AppChromeState, current: AppChromeState) {
|
||||
|
Loading…
Reference in New Issue
Block a user