mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-05-18 21:25:59 +02:00
common: guard against undefined backStack/forwardStack in TabSessionHistory (#9674)
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -163,13 +163,13 @@ export class TabSessionHistory {
|
||||
|
||||
canGoBack(id: string) {
|
||||
const tabHistory = this.options.get().tabSessionHistory[id];
|
||||
if (!tabHistory) return false;
|
||||
if (!tabHistory || !tabHistory.backStack) return false;
|
||||
return tabHistory.backStack.length > 1;
|
||||
}
|
||||
|
||||
canGoForward(id: string) {
|
||||
const tabHistory = this.options.get().tabSessionHistory[id];
|
||||
if (!tabHistory) return false;
|
||||
if (!tabHistory || !tabHistory.forwardStack) return false;
|
||||
return tabHistory.forwardStack.length >= 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user