mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-03 06:11:57 +08:00
lint + refactor
This commit is contained in:
parent
178e4a6527
commit
d1b45812d5
@ -24,6 +24,7 @@ export interface Reconnectable {
|
||||
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
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Injectable, Optional, Inject } from '@angular/core'
|
||||
import { BaseTabComponent, TabContextMenuItemProvider, NotificationsService, MenuItemOptions, TranslateService, SplitTabComponent } from 'tabby-core'
|
||||
import { BaseTerminalTabComponent } from './api/baseTerminalTab.component'
|
||||
import { tabIsReconnectable } from './api/interfaces'
|
||||
import { isReconnectable } from './api/interfaces'
|
||||
import { TerminalContextMenuItemProvider } from './api/contextMenuProvider'
|
||||
import { MultifocusService } from './services/multifocus.service'
|
||||
|
||||
@ -97,7 +97,7 @@ export class ReconnectContextMenu extends TabContextMenuItemProvider {
|
||||
) { super() }
|
||||
|
||||
async getItems (tab: BaseTabComponent): Promise<MenuItemOptions[]> {
|
||||
if (tabIsReconnectable(tab)) {
|
||||
if (isReconnectable(tab)) {
|
||||
return [
|
||||
{
|
||||
label: this.translate.instant('Reconnect'),
|
||||
|
Loading…
Reference in New Issue
Block a user