Skip to content

Commit 9869976

Browse files
committed
fix(anchor-tabs): resolve lint and type errors
- Fix prettier formatting: break long ternary in menu.fg.options.tabs.ts - Add anchored/anchoredAway to MTab reactive mock (ReactiveTabProps) - Add anchorUrl/anchorTitle fields to MTab class and TabSessionData interface so the restoreTab union type (TabSessionData | TabCache) resolves correctly
1 parent 79efa40 commit 9869976

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎src/defaults/mocks.tabs.fg.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export class MTab implements Tab {
3434
reopenInContainer?: string | undefined
3535
customTitle?: string | undefined
3636
customColor?: string | undefined
37+
anchorUrl?: string | undefined
38+
anchorTitle?: string | undefined
3739
moving?: boolean | undefined
3840
previewImg?: string | undefined
3941
removing?: boolean | undefined
@@ -65,6 +67,8 @@ export class MTab implements Tab {
6567
customColor: null,
6668
isGroup: false,
6769
preview: false,
70+
anchored: false,
71+
anchoredAway: false,
6872
}
6973
sessionData?: TabSessionData | undefined
7074
titleEl?: HTMLElement | undefined

‎src/services/menu.fg.options.tabs.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ export const tabsMenuOptions: Record<string, () => MenuOption | MenuOption[] | u
267267
return {
268268
label: translate('menu.tab.' + (firstTab.anchorUrl ? 'unanchor' : 'anchor')),
269269
icon: 'icon_undo',
270-
onClick: firstTab.anchorUrl ? () => Tabs.unanchorTabs(selected) : () => Tabs.anchorTabs(selected),
270+
onClick: firstTab.anchorUrl
271+
? () => Tabs.unanchorTabs(selected)
272+
: () => Tabs.anchorTabs(selected),
271273
}
272274
},
273275

‎src/types/tabs.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ export interface TabSessionData {
131131
folded: boolean
132132
customTitle?: string
133133
customColor?: string
134+
anchorUrl?: string
135+
anchorTitle?: string
134136
}
135137

136138
export interface ActiveTabsHistory {

0 commit comments

Comments
 (0)