mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-07 11:04:11 +08:00
🐛 fix hooks triggering issue
This commit is contained in:
parent
6b9d5182bf
commit
286d9da8d1
@ -73,7 +73,7 @@ export default () => {
|
||||
executeHooks('PluginEnter', ext);
|
||||
executeHooks('PluginReady', ext);
|
||||
console.log('enterrrr');
|
||||
|
||||
|
||||
const config = await localConfig.getConfig();
|
||||
const darkMode = config.perf.common.darkMode;
|
||||
darkMode &&
|
||||
@ -178,8 +178,11 @@ export default () => {
|
||||
const removeView = (window: BrowserWindow) => {
|
||||
if (!view) return;
|
||||
executeHooks('PluginOut', null);
|
||||
console.log('PluginOut hooks');
|
||||
|
||||
setTimeout(() => {
|
||||
window.removeBrowserView(view);
|
||||
console.log('remove view');
|
||||
if (!view.inDetach) {
|
||||
window.setBrowserView(null);
|
||||
view.webContents?.destroy();
|
||||
|
@ -91,7 +91,7 @@ class API extends DBInstance {
|
||||
}).show();
|
||||
}
|
||||
window.setSize(window.getSize()[0], 60);
|
||||
// this.removePlugin(null, window);
|
||||
this.removePlugin(null, window);
|
||||
// 模板文件
|
||||
if (!plugin.main) {
|
||||
plugin.tplPath = common.dev()
|
||||
@ -129,9 +129,7 @@ class API extends DBInstance {
|
||||
|
||||
public removePlugin(e, window) {
|
||||
runnerInstance.removeView(window);
|
||||
setTimeout(() => {
|
||||
this.currentPlugin = null;
|
||||
}, 100);
|
||||
this.currentPlugin = null;
|
||||
}
|
||||
|
||||
public openPluginDevTools() {
|
||||
@ -213,12 +211,15 @@ class API extends DBInstance {
|
||||
if (!Notification.isSupported()) return;
|
||||
'string' != typeof body && (body = String(body));
|
||||
const plugin = this.currentPlugin;
|
||||
if (!plugin) return;
|
||||
const notify = new Notification({
|
||||
title: plugin.pluginName,
|
||||
console.log('current plugin', this.currentPlugin);
|
||||
|
||||
const notification = {
|
||||
title: plugin ? plugin.pluginName : 'rubick',
|
||||
body,
|
||||
icon: plugin.logo,
|
||||
});
|
||||
icon: plugin ? plugin.logo : null,
|
||||
};
|
||||
|
||||
const notify = new Notification(notification);
|
||||
notify.show();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user