Skip to content

Commit

Permalink
🎨 #13410
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Dec 21, 2024
1 parent a6f98c6 commit be6f3a2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/src/protyle/render/av/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,10 +614,11 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
json.push([]);
}
json[json.length - 1].push(oldValue);
let newValue = value;
// relation 为全部更新,以下类型为添加
if (type === "mAsset") {
if (Array.isArray(value)) {
value = oldValue.mAsset.concat(value);
newValue = oldValue.mAsset.concat(value);
} else if (typeof value !== "undefined") { // 不传入为删除,传入字符串不进行处理
let link = protyle.lute.GetLinkDest(value);
let name = "";
Expand Down Expand Up @@ -645,14 +646,14 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
}
if (imgSrc) {
// 支持解析 ![]() https://github.com/siyuan-note/siyuan/issues/11487
value = oldValue.mAsset.concat({
newValue = oldValue.mAsset.concat({
type: "image",
content: imgSrc,
name: ""
});
} else {
// 支持解析 https://github.com/siyuan-note/siyuan/issues/11463
value = oldValue.mAsset.concat({
newValue = oldValue.mAsset.concat({
type: "file",
content: link,
name
Expand Down Expand Up @@ -685,10 +686,10 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
color: colorIndex.toString()
});
});
value = oldValue.mSelect.concat(newMSelectValue);
newValue = oldValue.mSelect.concat(newMSelectValue);
}
}
const cellValue = genCellValue(type, value);
const cellValue = genCellValue(type, newValue);
cellValue.id = cellId;
if ((cellValue.type === "date" && typeof cellValue.date === "string") ||
(cellValue.type === "relation" && typeof cellValue.relation === "string")) {
Expand Down

0 comments on commit be6f3a2

Please sign in to comment.