Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/9895

Vanessa97af8f874b3d
diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts
index f0cdfbad88..afa6cf58e5 100644
--- a/app/src/protyle/util/compatibility.ts
+++ b/app/src/protyle/util/compatibility.ts
@@ -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();
});
};
diff --git a/app/src/search/menu.ts b/app/src/search/menu.ts
index 1743ea37d8..ed8c03b926 100644
--- a/app/src/search/menu.ts
+++ b/app/src/search/menu.ts
@@ -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;