This commit is contained in:
Eugene Pankov
2020-03-01 16:10:45 +01:00
parent fda4d2dcef
commit 04a0a0cc64
81 changed files with 284 additions and 295 deletions

View File

@@ -27,7 +27,7 @@ export class ButtonProvider extends ToolbarButtonProvider {
title: 'Settings',
touchBarNSImage: 'NSTouchBarComposeTemplate',
weight: 10,
click: () => this.open(),
click: (): void => this.open(),
}]
}

View File

@@ -61,7 +61,7 @@ export class HotkeyInputModalComponent {
return keys.split('+').map((x) => x.trim())
}
ngOnInit () {
ngOnInit (): void {
this.keyTimeoutInterval = window.setInterval(() => {
if (!this.lastKeyEvent) {
return
@@ -74,14 +74,14 @@ export class HotkeyInputModalComponent {
this.hotkeys.disable()
}
ngOnDestroy () {
ngOnDestroy (): void {
this.keySubscription.unsubscribe()
this.hotkeys.clearCurrentKeystrokes()
this.hotkeys.enable()
clearInterval(this.keyTimeoutInterval!)
}
close () {
close (): void {
this.modalInstance.dismiss()
}
}

View File

@@ -17,7 +17,7 @@ export class MultiHotkeyInputComponent {
private ngbModal: NgbModal,
) { }
ngOnInit () {
ngOnInit (): void {
if (!this.model) {
this.model = []
}
@@ -27,7 +27,7 @@ export class MultiHotkeyInputComponent {
this.model = this.model.map(item => typeof item === 'string' ? [item] : item)
}
editItem (item) {
editItem (item: string[]): void {
this.ngbModal.open(HotkeyInputModalComponent).result.then((value: string[]) => {
this.model[this.model.findIndex(x => x === item)] = value
this.model = this.model.slice()
@@ -35,14 +35,14 @@ export class MultiHotkeyInputComponent {
})
}
addItem () {
addItem (): void {
this.ngbModal.open(HotkeyInputModalComponent).result.then((value: string[]) => {
this.model = this.model.concat([value])
this.modelChange.emit(this.model)
})
}
removeItem (item) {
removeItem (item: string[]): void {
this.model = this.model.filter(x => x !== item)
this.modelChange.emit(this.model)
}

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import * as yaml from 'js-yaml'
import { Subscription } from 'rxjs'
import { Component, Inject, Input, HostBinding, NgZone } from '@angular/core'

View File

@@ -13,7 +13,7 @@ export class SettingsTabBodyComponent {
constructor (private componentFactoryResolver: ComponentFactoryResolver) { }
ngAfterViewInit () {
ngAfterViewInit (): void {
// run after the change detection finishes
setImmediate(() => {
this.component = this.placeholder.createComponent(