mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 14:04:56 +00:00
fixed AppService.selectTab crash
This commit is contained in:
@@ -49,10 +49,10 @@ export class AppService {
|
|||||||
get activeTab (): BaseTabComponent|null { return this._activeTab ?? null }
|
get activeTab (): BaseTabComponent|null { return this._activeTab ?? null }
|
||||||
|
|
||||||
private lastTabIndex = 0
|
private lastTabIndex = 0
|
||||||
private _activeTab?: BaseTabComponent
|
private _activeTab: BaseTabComponent | null = null
|
||||||
private closedTabsStack: RecoveryToken[] = []
|
private closedTabsStack: RecoveryToken[] = []
|
||||||
|
|
||||||
private activeTabChange = new Subject<BaseTabComponent>()
|
private activeTabChange = new Subject<BaseTabComponent|null>()
|
||||||
private tabsChanged = new Subject<void>()
|
private tabsChanged = new Subject<void>()
|
||||||
private tabOpened = new Subject<BaseTabComponent>()
|
private tabOpened = new Subject<BaseTabComponent>()
|
||||||
private tabClosed = new Subject<BaseTabComponent>()
|
private tabClosed = new Subject<BaseTabComponent>()
|
||||||
@@ -60,7 +60,7 @@ export class AppService {
|
|||||||
|
|
||||||
private completionObservers = new Map<BaseTabComponent, CompletionObserver>()
|
private completionObservers = new Map<BaseTabComponent, CompletionObserver>()
|
||||||
|
|
||||||
get activeTabChange$ (): Observable<BaseTabComponent> { return this.activeTabChange }
|
get activeTabChange$ (): Observable<BaseTabComponent|null> { return this.activeTabChange }
|
||||||
get tabOpened$ (): Observable<BaseTabComponent> { return this.tabOpened }
|
get tabOpened$ (): Observable<BaseTabComponent> { return this.tabOpened }
|
||||||
get tabsChanged$ (): Observable<void> { return this.tabsChanged }
|
get tabsChanged$ (): Observable<void> { return this.tabsChanged }
|
||||||
get tabClosed$ (): Observable<BaseTabComponent> { return this.tabClosed }
|
get tabClosed$ (): Observable<BaseTabComponent> { return this.tabClosed }
|
||||||
@@ -185,8 +185,8 @@ export class AppService {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
selectTab (tab: BaseTabComponent): void {
|
selectTab (tab: BaseTabComponent|null): void {
|
||||||
if (this._activeTab === tab) {
|
if (tab && this._activeTab === tab) {
|
||||||
this._activeTab.emitFocused()
|
this._activeTab.emitFocused()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ export class AppService {
|
|||||||
setImmediate(() => {
|
setImmediate(() => {
|
||||||
this._activeTab?.emitFocused()
|
this._activeTab?.emitFocused()
|
||||||
})
|
})
|
||||||
this.hostApp.setTitle(this._activeTab.title)
|
this.hostApp.setTitle(this._activeTab?.title)
|
||||||
}
|
}
|
||||||
|
|
||||||
getParentTab (tab: BaseTabComponent): SplitTabComponent|null {
|
getParentTab (tab: BaseTabComponent): SplitTabComponent|null {
|
||||||
|
@@ -242,8 +242,8 @@ export class HostAppService {
|
|||||||
this.electron.ipcRenderer.send('window-set-vibrancy', enable, type)
|
this.electron.ipcRenderer.send('window-set-vibrancy', enable, type)
|
||||||
}
|
}
|
||||||
|
|
||||||
setTitle (title: string): void {
|
setTitle (title?: string): void {
|
||||||
this.electron.ipcRenderer.send('window-set-title', title)
|
this.electron.ipcRenderer.send('window-set-title', title ?? 'Terminus')
|
||||||
}
|
}
|
||||||
|
|
||||||
setTouchBar (touchBar: TouchBar): void {
|
setTouchBar (touchBar: TouchBar): void {
|
||||||
|
Reference in New Issue
Block a user