mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
4e72a15125
commit
8cc40c066a
2 changed files with 0 additions and 18 deletions
|
|
@ -242,12 +242,6 @@ export const about = {
|
||||||
fetchPost("/api/system/setWorkspaceDir", {
|
fetchPost("/api/system/setWorkspaceDir", {
|
||||||
path: workspace
|
path: workspace
|
||||||
}, () => {
|
}, () => {
|
||||||
const searchData = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEDATA) || "{}");
|
|
||||||
if (searchData.hPath) {
|
|
||||||
searchData.hPath = "";
|
|
||||||
searchData.idPath = "";
|
|
||||||
localStorage.setItem(Constants.LOCAL_SEARCHEDATA, JSON.stringify(searchData));
|
|
||||||
}
|
|
||||||
exportLayout(false, () => {
|
exportLayout(false, () => {
|
||||||
exitSiYuan();
|
exitSiYuan();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -152,18 +152,6 @@ export const setLocalStorage = () => {
|
||||||
exportLocalStorage();
|
exportLocalStorage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 复写 localStorage
|
|
||||||
window.__localStorage__setItem = localStorage.setItem;
|
|
||||||
window.__localStorage__removeItem = localStorage.removeItem;
|
|
||||||
localStorage.setItem = function (key, val) {
|
|
||||||
window.__localStorage__setItem.call(this, key, val);
|
|
||||||
fetchPost("/api/storage/setLocalStorageVal", {key, val});
|
|
||||||
};
|
|
||||||
localStorage.removeItem = function (key) {
|
|
||||||
window.__localStorage__removeItem.call(this, key);
|
|
||||||
fetchPost("/api/storage/removeLocalStorageVal", {key});
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const exportLocalStorage = (cb?: () => void) => {
|
export const exportLocalStorage = (cb?: () => void) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue