mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/16149 https://github.com/siyuan-note/siyuan/issues/16121
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
0ffa864c8f
commit
b4e10e5704
3 changed files with 17 additions and 5 deletions
|
|
@ -6,7 +6,13 @@ import {getDockByType} from "../tabUtil";
|
|||
import {fetchPost} from "../../util/fetch";
|
||||
import {getAllModels} from "../getAll";
|
||||
import {hasClosestBlock, hasClosestByClassName, hasTopClosestByClassName} from "../../protyle/util/hasClosest";
|
||||
import {setStorageVal, updateHotkeyAfterTip, updateHotkeyTip} from "../../protyle/util/compatibility";
|
||||
import {
|
||||
isInAndroid,
|
||||
isInHarmony,
|
||||
setStorageVal,
|
||||
updateHotkeyAfterTip,
|
||||
writeText
|
||||
} from "../../protyle/util/compatibility";
|
||||
import {openFileById} from "../../editor/util";
|
||||
import {Constants} from "../../constants";
|
||||
import {MenuItem} from "../../menus/Menu";
|
||||
|
|
@ -18,7 +24,6 @@ import {checkFold} from "../../util/noRelyPCFunction";
|
|||
import {transaction, turnsIntoTransaction} from "../../protyle/wysiwyg/transaction";
|
||||
import {goHome} from "../../protyle/wysiwyg/commonHotkey";
|
||||
import {Editor} from "../../editor";
|
||||
import {writeText, isInAndroid, isInHarmony} from "../../protyle/util/compatibility";
|
||||
import {mathRender} from "../../protyle/render/mathRender";
|
||||
import {genEmptyElement} from "../../block/util";
|
||||
import {focusBlock, focusByWbr} from "../../protyle/util/selection";
|
||||
|
|
@ -658,6 +663,10 @@ export class Outline extends Model {
|
|||
}
|
||||
|
||||
public saveExpendIds() {
|
||||
if (window.siyuan.config.readonly || window.siyuan.isPublish) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.isPreview && this.type === "pin") {
|
||||
fetchPost("/api/storage/setOutlineStorage", {
|
||||
docID: this.blockId,
|
||||
|
|
|
|||
|
|
@ -251,6 +251,10 @@ export class Plugin {
|
|||
}
|
||||
|
||||
public saveData(storageName: string, data: any) {
|
||||
if (window.siyuan.config.readonly || window.siyuan.isPublish) {
|
||||
return;
|
||||
}
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const pathString = `/data/storage/petal/${this.name}/${storageName}`;
|
||||
let file: File;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ import {focusByRange} from "./selection";
|
|||
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||
import {Constants} from "../../constants";
|
||||
/// #if !BROWSER
|
||||
import {clipboard} from "electron";
|
||||
import {ipcRenderer} from "electron";
|
||||
import {clipboard, ipcRenderer} from "electron";
|
||||
/// #endif
|
||||
|
||||
export const encodeBase64 = (text: string): string => {
|
||||
|
|
@ -500,7 +499,7 @@ export const getLocalStorage = (cb: () => void) => {
|
|||
};
|
||||
|
||||
export const setStorageVal = (key: string, val: any, cb?: () => void) => {
|
||||
if (window.siyuan.config.readonly) {
|
||||
if (window.siyuan.config.readonly || window.siyuan.isPublish) {
|
||||
return;
|
||||
}
|
||||
fetchPost("/api/storage/setLocalStorageVal", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue