mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-09 05:50:08 +00:00
lint + refactor
This commit is contained in:
parent
178e4a6527
commit
d1b45812d5
@ -24,6 +24,7 @@ export interface Reconnectable {
|
|||||||
reconnect: () => Promise<void>;
|
reconnect: () => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function tabIsReconnectable (object: any): object is Reconnectable {
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||||
|
export function isReconnectable (object: any): object is Reconnectable {
|
||||||
return 'reconnect' in object
|
return 'reconnect' in object
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Injectable, Optional, Inject } from '@angular/core'
|
import { Injectable, Optional, Inject } from '@angular/core'
|
||||||
import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService, SplitTabComponent } from 'tabby-core'
|
import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService, SplitTabComponent } from 'tabby-core'
|
||||||
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
||||||
import { tabIsReconnectable } from './api/interfaces'
|
import { isReconnectable } from './api/interfaces'
|
||||||
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
||||||
import { MultifocusService } from './services/multifocus.service'
|
import { MultifocusService } from './services/multifocus.service'
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ export class ReconnectContextMenu extends TabContextMenuItemProvider {
|
|||||||
) { super() }
|
) { super() }
|
||||||
|
|
||||||
async getItems (tab: BaseTabComponent): Promise<MenuItemOptions[]> {
|
async getItems (tab: BaseTabComponent): Promise<MenuItemOptions[]> {
|
||||||
if (tabIsReconnectable(tab)) {
|
if (isReconnectable(tab)) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: this.translate.instant('Reconnect'),
|
label: this.translate.instant('Reconnect'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user