🐛 修复插件市场搜索空白问题

This commit is contained in:
muwoo
2021-12-22 14:58:42 +08:00
parent 5cfaa70c67
commit dc656d3bca
15 changed files with 35 additions and 10 deletions

View File

@@ -1,16 +1,15 @@
import path from "path";
import fs from "fs";
import getLocalDataFile from "./getLocalDataFile";
import { app } from "electron";
import commonConst from "./commonConst";
const configPath = path.join(getLocalDataFile(), "./rubick-config.json");
const defaultConfigForAnyPlatform = {
version: 1,
version: 2,
perf: {
shortCut: {
showAndHidden: "Option+R",
showAndHidden: "OptionOrAlt+R",
separate: "Ctrl+D",
quit: "Shift+Escape",
},
@@ -19,6 +18,7 @@ const defaultConfigForAnyPlatform = {
space: true,
// 是否失焦隐藏。默认在dev环境不隐藏在打包后隐藏。
hideOnBlur: commonConst.production(),
autoPast: false,
},
local: {
search: true,

View File

@@ -23,6 +23,7 @@ const API: any = {
DBKEY: "RUBICK_DB_DEFAULT",
openPlugin({ plugin }, window) {
if (API.currentPlugin && API.currentPlugin.name === plugin.name) return;
window.setSize(window.getSize()[0], 60);
runnerInstance.removeView(window);
runnerInstance.init(plugin, window);
API.currentPlugin = plugin;

View File

@@ -12,6 +12,10 @@ export default ({
}) => {
const clipboardFile: any = ref([]);
const searchFocus = () => {
const config = remote.getGlobal("OP_CONFIG").get();
// 未开启自动粘贴
if (!config.perf.common.autoPast) return;
if (currentPlugin.value.name) return;
const fileList = getCopyFiles();
// 拷贝的是文件

View File

@@ -71,6 +71,7 @@ const createPluginManager = (): any => {
);
return {
...pluginInfo,
icon: pluginInfo.logo,
indexPath: commonConst.dev()
? "http://localhost:8081/#/"
: `file://${path.join(pluginPath, "../", pluginInfo.main)}`,

View File

@@ -26,5 +26,11 @@ export default function pluginClickEvent({ plugin, fe, cmd, ext, openPlugin }) {
? "http://localhost:8082/#/"
: `file://${__static}/tpl/index.html`;
}
// 插件市场
if (plugin.name === "rubick-system-feature") {
pluginDist.indexPath = commonConst.dev()
? "http://localhost:8081/#/"
: `file://${__static}/feature/index.html`;
}
openPlugin(pluginDist);
}