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.

23 lines
511 B

3 years ago
3 years ago
3 years ago
3 years ago
  1. const { BrowserWindow } = require('electron')
  2. const { createWindow } = require('./lib/common')
  3. // props: { id: 'TIS_APP_TEMPLATE_KT', entry: '' }
  4. const create = (props,options) => {
  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. ...options,
  15. })
  16. win[props.id] = Symbol(props.id);
  17. return win
  18. }
  19. module.exports = { create }