electron launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
473 B

  1. const { BrowserWindow } = require('electron')
  2. const { createWindow } = require('./lib/common')
  3. // props: { id: 'TIS_APP_TEMPLATE_KT', entry: '' }
  4. const create = props => {
  5. const windows = BrowserWindow.getAllWindows()
  6. const found = windows.find(w => w[props.id])
  7. if (found) {
  8. found.show()
  9. found.center()
  10. return found
  11. }
  12. const win = createWindow(props.entry, {
  13. show: true
  14. })
  15. win[props.id] = true
  16. return win
  17. }
  18. module.exports = { create }