dsh-plugin-pack 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +23 -13
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -2228,7 +2228,13 @@ window.__ModuleLoader__.load({ id: 'dsh-plugin-pack', factory: (require) => {
|
|
|
2228
2228
|
}
|
|
2229
2229
|
|
|
2230
2230
|
if (quick && Array.isArray(quick.names) && quick.names.length) {
|
|
2231
|
-
|
|
2231
|
+
/* 现取一次状态,不要用打开面板时缓存的那份。
|
|
2232
|
+
* 用户可能刚装完插件就拖包进来,缓存里还没有那两个,
|
|
2233
|
+
* 结果全部被标成「新建」——既不弹覆盖/跳过,又会重复装一遍。
|
|
2234
|
+
* 服务端扫描结果有缓存(按目录 mtime 失效),所以这次调用很快。 */
|
|
2235
|
+
const freshStatus = await getStatus().catch(() => null);
|
|
2236
|
+
const sourcePlugins = freshStatus?.plugins ?? status?.plugins ?? [];
|
|
2237
|
+
const installed = new Map(sourcePlugins.map((plugin) => [plugin.name, plugin]));
|
|
2232
2238
|
const packPlugins = (quick.manifest?.plugins ?? []).filter(Boolean);
|
|
2233
2239
|
const conflicts = packPlugins
|
|
2234
2240
|
.filter((plugin) => installed.has(plugin.name))
|
|
@@ -2272,18 +2278,22 @@ window.__ModuleLoader__.load({ id: 'dsh-plugin-pack', factory: (require) => {
|
|
|
2272
2278
|
};
|
|
2273
2279
|
});
|
|
2274
2280
|
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2281
|
+
/* manifest 里没有 plugins 清单(老包或手工拼的)就别弹空框,
|
|
2282
|
+
* 让下面的上传 + dryRun 用服务端的真实结果来问。 */
|
|
2283
|
+
if (rows.length) {
|
|
2284
|
+
setPendingImport({
|
|
2285
|
+
kind: 'bundle',
|
|
2286
|
+
pendingFile: file, // 还没上传,先拿着 File 对象
|
|
2287
|
+
file: null,
|
|
2288
|
+
conflicts: rows.filter((row) => row.exists),
|
|
2289
|
+
rows,
|
|
2290
|
+
plugins: packPlugins,
|
|
2291
|
+
quick: true,
|
|
2292
|
+
});
|
|
2293
|
+
setBusy(false);
|
|
2294
|
+
setPhase('');
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2287
2297
|
}
|
|
2288
2298
|
|
|
2289
2299
|
// 第二步:确认无冲突(或拿不到快速清单)才上传
|
package/package.json
CHANGED