Vanessa 2023-12-17 11:45:20 +08:00
parent 0d0f515211
commit 97af8f874b
2 changed files with 7 additions and 4 deletions

View file

@ -263,10 +263,12 @@ export const getLocalStorage = (cb: () => void) => {
} else if (typeof response.data[key] === "undefined") {
window.siyuan.storage[key] = defaultStorage[key];
}
if (!window.siyuan.storage[Constants.LOCAL_SEARCHDATA].replaceTypes) {
window.siyuan.storage[Constants.LOCAL_SEARCHDATA].replaceTypes = Constants.SIYUAN_DEFAULT_REPLACETYPES;
}
});
// 搜索数据添加 replaceTypes 兼容
if (!window.siyuan.storage[Constants.LOCAL_SEARCHDATA].replaceTypes ||
Object.keys(window.siyuan.storage[Constants.LOCAL_SEARCHDATA].replaceTypes).length === 0) {
window.siyuan.storage[Constants.LOCAL_SEARCHDATA].replaceTypes = Constants.SIYUAN_DEFAULT_REPLACETYPES;
}
cb();
});
};

View file

@ -554,7 +554,8 @@ export const moreMenu = async (config: ISearchOption,
const configIsSame = (config: ISearchOption, config2: ISearchOption) => {
if (config2.group === config.group && config2.hPath === config.hPath && config2.hasReplace === config.hasReplace &&
config2.k === config.k && config2.method === config.method && config2.r === config.r &&
config2.sort === config.sort && objEquals(config2.types, config.types) && objEquals(config2.idPath, config.idPath)) {
config2.sort === config.sort && objEquals(config2.types, config.types) &&
objEquals(config2.replaceTypes, config.replaceTypes) && objEquals(config2.idPath, config.idPath)) {
return true;
}
return false;