mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-26 12:42:34 +08:00
🐛 fix #185
This commit is contained in:
@@ -78,6 +78,7 @@ export default () => {
|
||||
window.setBrowserView(view);
|
||||
view.webContents.loadURL(pluginIndexPath);
|
||||
view.webContents.once('dom-ready', () => {
|
||||
if (!view) return;
|
||||
const height = pluginSetting && pluginSetting.height;
|
||||
window.setSize(800, height || 660);
|
||||
view.setBounds({ x: 0, y: 60, width: 800, height: height || 600 });
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
/* eslint-disable */
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import { PLUGIN_INSTALL_DIR } from "@/common/constans/main";
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { PLUGIN_INSTALL_DIR } from '@/common/constans/main';
|
||||
|
||||
export default () => {
|
||||
// 读取所有插件
|
||||
const totalPlugins = global.LOCAL_PLUGINS.getLocalPlugins();
|
||||
let systemPlugins = totalPlugins.filter((plugin) => plugin.pluginType === "system");
|
||||
let systemPlugins = totalPlugins.filter(
|
||||
(plugin) => plugin.pluginType === 'system'
|
||||
);
|
||||
systemPlugins = systemPlugins.map((plugin) => {
|
||||
const pluginPath = path.resolve(
|
||||
PLUGIN_INSTALL_DIR,
|
||||
"node_modules",
|
||||
'node_modules',
|
||||
plugin.name
|
||||
);
|
||||
return {
|
||||
...plugin,
|
||||
indexPath: path.join(
|
||||
pluginPath,
|
||||
"./",
|
||||
plugin.entry
|
||||
),
|
||||
}
|
||||
indexPath: path.join(pluginPath, './', plugin.entry),
|
||||
};
|
||||
});
|
||||
|
||||
const hooks = {
|
||||
@@ -39,14 +37,14 @@ export default () => {
|
||||
// @ts-ignore
|
||||
hooks.onReady.forEach((hook: any) => {
|
||||
try {
|
||||
hook(ctx);
|
||||
hook && hook(ctx);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
triggerReadyHooks
|
||||
triggerReadyHooks,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user