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
23 lines
511 B
const { BrowserWindow } = require('electron')
|
|
const { createWindow } = require('./lib/common')
|
|
|
|
// props: { id: 'TIS_APP_TEMPLATE_KT', entry: '' }
|
|
const create = (props,options) => {
|
|
const windows = BrowserWindow.getAllWindows()
|
|
const found = windows.find(w => w[props.id])
|
|
if (found) {
|
|
found.show()
|
|
found.center()
|
|
return found
|
|
}
|
|
|
|
const win = createWindow(props.entry, {
|
|
show: true,
|
|
...options,
|
|
})
|
|
win[props.id] = Symbol(props.id);
|
|
|
|
return win
|
|
}
|
|
|
|
module.exports = { create }
|