♻️ search 框输入交互优化

This commit is contained in:
muwoo
2021-12-08 15:51:54 +08:00
parent 951f21f5fa
commit 8a35e60e48
17 changed files with 253 additions and 24 deletions

View File

@@ -34,15 +34,17 @@ global.LOCAL_PLUGINS = {
},
addPlugin(plugin) {
let has = false;
global.LOCAL_PLUGINS.PLUGINS.some((p) => {
const currentPlugins = global.LOCAL_PLUGINS.getLocalPlugins();
currentPlugins.some((p) => {
has = p.name === plugin.name;
return has;
});
if (!has) {
global.LOCAL_PLUGINS.PLUGINS.unshift(plugin);
currentPlugins.unshift(plugin);
global.LOCAL_PLUGINS.PLUGINS = currentPlugins;
fs.writeFileSync(
configPath,
JSON.stringify(global.LOCAL_PLUGINS.PLUGINS)
JSON.stringify(currentPlugins)
);
}
},