🐛 修复部分问题

This commit is contained in:
muwoo
2023-09-01 17:56:16 +08:00
parent f4f91e1639
commit 6dffd1a793
17 changed files with 68 additions and 30 deletions

View File

@@ -94,7 +94,7 @@
:title="$t('feature.installed.removeFromPanel')"
>
<MinusCircleOutlined
@click="removePluginToSuperPanel(cmd)"
@click="removePluginToSuperPanel({ cmd })"
/>
</a-tooltip>
</template>
@@ -145,9 +145,9 @@ const pluginDetail = computed(() => {
});
const superPanelPlugins = ref(
window.rubick.db.get('super-panel-plugins') || {
window.rubick.db.get('super-panel-user-plugins') || {
data: [],
_id: 'super-panel-plugins',
_id: 'super-panel-user-plugins',
}
);
@@ -165,9 +165,10 @@ const addCmdToSuperPanel = ({ cmd, code }) => {
window.rubick.db.put(toRaw(superPanelPlugins.value));
};
const removePluginToSuperPanel = (cmd) => {
const removePluginToSuperPanel = ({ cmd, name }) => {
superPanelPlugins.value.data = toRaw(superPanelPlugins.value).data.filter(
(item) => {
if (name) return item.name !== name;
return item.cmd !== cmd;
}
);
@@ -224,9 +225,12 @@ const deletePlugin = async (plugin) => {
message.error('卸载超时,请重试!');
}, 20000);
await window.market.deletePlugin(plugin);
removePluginToSuperPanel({ name: plugin.name });
updateLocalPlugin();
clearTimeout(timer);
};
</script>
<style lang="less" scoped>