Skip to content

Commit 240175c

Browse files
committed
🐛 修复系统插件无法打开ui界面问题
1 parent 8107d74 commit 240175c

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rubick",
3-
"version": "2.0.1-beta.16",
3+
"version": "2.0.1-beta.17",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

src/common/utils/localConfig.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import path from "path";
22
import fs from "fs";
33
import getLocalDataFile from "./getLocalDataFile";
4-
import commonConst from "./commonConst";
54
import defaultConfigForAnyPlatform from "../constans/defaultConfig";
65

76
const configPath = path.join(getLocalDataFile(), "./rubick-config.json");
@@ -10,34 +9,34 @@ global.OP_CONFIG = {
109
config: null,
1110
get() {
1211
try {
13-
if (!global.config) {
14-
global.config = JSON.parse(
12+
if (!global.OP_CONFIG.config) {
13+
global.OP_CONFIG.config = JSON.parse(
1514
fs.readFileSync(configPath, "utf8") ||
1615
JSON.stringify(defaultConfigForAnyPlatform)
1716
);
1817
}
1918
// 重置
2019
if (
21-
!global.config.version ||
22-
global.config.version < defaultConfigForAnyPlatform.version
20+
!global.OP_CONFIG.config.version ||
21+
global.OP_CONFIG.config.version < defaultConfigForAnyPlatform.version
2322
) {
24-
global.config = defaultConfigForAnyPlatform;
23+
global.OP_CONFIG.config = defaultConfigForAnyPlatform;
2524
fs.writeFileSync(
2625
configPath,
2726
JSON.stringify(defaultConfigForAnyPlatform)
2827
);
2928
}
30-
return global.config;
29+
return global.OP_CONFIG.config;
3130
} catch (e) {
32-
global.config = defaultConfigForAnyPlatform;
33-
return global.config;
31+
global.OP_CONFIG.config = defaultConfigForAnyPlatform;
32+
return global.OP_CONFIG.config;
3433
}
3534
},
3635
set(value) {
37-
global.config = {
38-
...global.config,
36+
global.OP_CONFIG.config = {
37+
...global.OP_CONFIG.config,
3938
...value,
4039
};
41-
fs.writeFileSync(configPath, JSON.stringify(global.config));
40+
fs.writeFileSync(configPath, JSON.stringify(global.OP_CONFIG.config));
4241
},
4342
};

src/renderer/plugins-manager/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const createPluginManager = (): any => {
2828
};
2929

3030
const openPlugin = (plugin) => {
31-
if (plugin.pluginType === "ui") {
31+
if (plugin.pluginType === "ui" || plugin.pluginType === "system") {
3232
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
3333
return;
3434
}

0 commit comments

Comments
 (0)