mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-30 07:39:54 +08:00
♻️ 优化插件中心功能
This commit is contained in:
@@ -53,6 +53,21 @@ export default createStore({
|
||||
totalPlugins,
|
||||
});
|
||||
},
|
||||
|
||||
startUnDownload({ commit, state }, name) {
|
||||
const localPlugins = (window as any).market.getLocalPlugins();
|
||||
localPlugins.forEach(
|
||||
(origin: { isdwonload?: any; name?: any; isloading: boolean }) => {
|
||||
if (origin.name === name) {
|
||||
origin.isloading = true;
|
||||
}
|
||||
}
|
||||
);
|
||||
commit("commonUpdate", {
|
||||
localPlugins,
|
||||
});
|
||||
},
|
||||
|
||||
successDownload({ commit, state }, name) {
|
||||
const totalPlugins = JSON.parse(JSON.stringify(state.totalPlugins));
|
||||
totalPlugins.forEach(
|
||||
@@ -70,10 +85,20 @@ export default createStore({
|
||||
localPlugins,
|
||||
});
|
||||
},
|
||||
updateLocalPlugin({ commit }) {
|
||||
async updateLocalPlugin({ commit }) {
|
||||
const localPlugins = (window as any).market.getLocalPlugins();
|
||||
const totalPlugins = await request.getTotalPlugins();
|
||||
|
||||
totalPlugins.forEach(
|
||||
(origin: { isdwonload?: any; name?: any; isloading: boolean }) => {
|
||||
origin.isdwonload = isDownload(origin, localPlugins);
|
||||
origin.isloading = false;
|
||||
}
|
||||
);
|
||||
|
||||
commit("commonUpdate", {
|
||||
localPlugins,
|
||||
totalPlugins,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user