fix(substore): refresh stale common utilities
This commit is contained in:
+8
-2
@@ -5,10 +5,13 @@
|
||||
* - 基于归一化后的完整名称做精准去重
|
||||
*/
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
const COMMON_SCRIPT_URL = 'https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-4';
|
||||
const COMMON_SCRIPT_URL = 'https://git.orionc.me/orion/script/raw/branch/main/substore/common.js?v=20260603-5';
|
||||
const hasCurrentRenameUtils = utils => Boolean(
|
||||
utils && typeof utils.normalizeLeadingMojibakeFlag === 'function'
|
||||
);
|
||||
|
||||
async function loadRenameUtils() {
|
||||
if (typeof globalThis !== 'undefined' && globalThis.SubStoreRenameUtils) {
|
||||
if (typeof globalThis !== 'undefined' && hasCurrentRenameUtils(globalThis.SubStoreRenameUtils)) {
|
||||
return globalThis.SubStoreRenameUtils;
|
||||
}
|
||||
|
||||
@@ -21,6 +24,9 @@ async function loadRenameUtils() {
|
||||
}
|
||||
|
||||
new Function(String(script))();
|
||||
if (!hasCurrentRenameUtils(globalThis.SubStoreRenameUtils)) {
|
||||
throw new Error('Loaded common.js is missing current rename utilities');
|
||||
}
|
||||
return globalThis.SubStoreRenameUtils;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user