Skip to content

Commit

Permalink
fix: sessions.getTab/WindowValue: return type
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnuqw committed Dec 29, 2024
1 parent 101b737 commit 6147472
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/services/sidebar.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export async function loadPanels(): Promise<void> {

// Activate last active panel
if (!Windows.incognito) {
let actPanel: Panel | undefined = Sidebar.panelsById[activeId]
let actPanel: Panel | undefined
if (activeId !== undefined) actPanel = Sidebar.panelsById[activeId]
if (!actPanel) actPanel = Sidebar.panels.find(p => p.type === PanelType.tabs)
if (actPanel) Sidebar.reactive.activePanelId = Sidebar.activePanelId = actPanel.id
else Sidebar.reactive.activePanelId = Sidebar.activePanelId = Sidebar.panels[0]?.id ?? NOID
Expand Down
4 changes: 2 additions & 2 deletions src/types/web-ext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ declare namespace browser {
function getRecentlyClosed(filter?: Filter): Promise<Session[]>
function restore(sessionId: string): Promise<Session>
function setWindowValue<T>(windowId: ID, key: string, value: T): Promise<void>
function getWindowValue<T>(id: ID, key: string): Promise<T>
function getWindowValue<T>(id: ID, key: string): Promise<T | undefined>
function setTabValue<T>(tabId: ID, key: string, value: T): Promise<void>
function getTabValue<T>(tabId: ID, key: string): Promise<T>
function getTabValue<T>(tabId: ID, key: string): Promise<T | undefined>
function forgetClosedWindow(sessionId: string): Promise<void>
function forgetClosedTab(windowId: number, sessionId: string): Promise<void>

Expand Down

0 comments on commit 6147472

Please sign in to comment.