do not update if path is the same.

This commit is contained in:
Niels Lyngsø
2023-01-10 22:17:45 +01:00
parent fd28ffba4c
commit 5b00ba4322

View File

@@ -9,7 +9,7 @@ export type UmbCurrentUserHistoryItem = {
};
export class UmbCurrentUserHistoryStore {
#history = new UniqueBehaviorSubject(
<Array<UmbCurrentUserHistoryItem>>[]
);
@@ -40,11 +40,6 @@ export class UmbCurrentUserHistoryStore {
// This prevents duplicate entries in the history array.
if (!lastItem || lastItem.path !== historyItem.path) {
this.#history.next([...this.#history.getValue(), historyItem]);
} else {
//Update existing item
const newHistory = this.#history.getValue();
newHistory[history.length - 1] = historyItem;
this.#history.next(newHistory);
}
}