import { PopupType } from '../../models/popup'
import { Dispatcher } from '../../ui/dispatcher'

class TrampolineUIHelper {
  // The dispatcher must be set before this helper can do anything
  private dispatcher!: Dispatcher

  public setDispatcher(dispatcher: Dispatcher) {
    this.dispatcher = dispatcher
  }

  public promptAddingSSHHost(
    host: string,
    ip: string,
    fingerprint: string
  ): Promise<boolean> {
    return new Promise(resolve => {
      this.dispatcher.showPopup({
        type: PopupType.AddSSHHost,
        host,
        ip,
        fingerprint,
        onSubmit: addHost => resolve(addHost),
      })
    })
  }

  public promptSSHKeyPassphrase(keyPath: string): Promise<string | undefined> {
    return new Promise(resolve => {
      this.dispatcher.showPopup({
        type: PopupType.SSHKeyPassphrase,
        keyPath,
        onSubmit: passphrase => resolve(passphrase),
      })
    })
  }
}

export const trampolineUIHelper = new TrampolineUIHelper()

import { PopupType } from '../../models/popup'
import { Dispatcher } from '../../ui/dispatcher'

class TrampolineUIHelper {
  // The dispatcher must be set before this helper can do anything
  private dispatcher!: Dispatcher

  public setDispatcher(dispatcher: Dispatcher) {
    this.dispatcher = dispatcher
  }

  public promptAddingSSHHost(
    host: string,
    ip: string,
    fingerprint: string
  ): Promise<boolean> {
    return new Promise(resolve => {
      this.dispatcher.showPopup({
        type: PopupType.AddSSHHost,
        host,
        ip,
        fingerprint,
        onSubmit: resolve,
      })
    })
  }

  public promptSSHKeyPassphrase(keyPath: string): Promise<string | undefined> {
    return new Promise(resolve => {
      this.dispatcher.showPopup({
        type: PopupType.SSHKeyPassphrase,
        keyPath,
        onSubmit: resolve,
      })
    })
  }
}

export const trampolineUIHelper = new TrampolineUIHelper()

--- 
+++ 
@@ -20,7 +20,7 @@
         host,
         ip,
         fingerprint,
-        onSubmit: resolve,
+        onSubmit: addHost => resolve(addHost),
       })
     })
   }
@@ -30,7 +30,7 @@
       this.dispatcher.showPopup({
         type: PopupType.SSHKeyPassphrase,
         keyPath,
-        onSubmit: resolve,
+        onSubmit: passphrase => resolve(passphrase),
       })
     })
   }
Fix lint checks with some promises
