app and win functionality in plugin
This commit is contained in:
parent
e8b6dd3180
commit
ba58d456ac
3 changed files with 21 additions and 14 deletions
|
@ -23,7 +23,7 @@ export default class PluginHandler {
|
|||
if (plugins[file] || plugin.name in plugins) {
|
||||
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
|
||||
} else {
|
||||
plugins[file] = new plugin();
|
||||
plugins[file] = new plugin(electron.app);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -33,11 +33,11 @@ export default class PluginHandler {
|
|||
if (fs.existsSync(this.userPluginsPath)) {
|
||||
fs.readdirSync(this.userPluginsPath).forEach(file => {
|
||||
if (file.endsWith('.ts') || file.endsWith('.js')) {
|
||||
const plugin = require(path.join(this.userPluginsPath, file));
|
||||
const plugin = require(path.join(this.userPluginsPath, file)).default;
|
||||
if (plugins[file] || plugin in plugins) {
|
||||
console.log(`[${plugin.default}] Plugin already loaded / Duplicate Class Name`);
|
||||
console.log(`[${plugin.name}] Plugin already loaded / Duplicate Class Name`);
|
||||
} else {
|
||||
plugins[file] = new plugin.default();
|
||||
plugins[file] = new plugin(electron.app);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -54,4 +54,4 @@ export default class PluginHandler {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue