Skip to content

Commit

Permalink
🎨 fix #11469
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed May 20, 2024
1 parent 46c2115 commit 407dd38
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/src/protyle/render/av/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ export const bindAssetEvent = (options: {
export const getAssetHTML = (cellElements: HTMLElement[]) => {
let html = "";
genCellValueByElement("mAsset", cellElements[0]).mAsset.forEach((item, index) => {
if (!item.content) {
return;
}
let contentHTML;
if (item.type === "image") {
contentHTML = `<span data-type="openAssetItem" class="fn__flex-1 ariaLabel" aria-label="${item.content}">
Expand Down Expand Up @@ -188,8 +185,7 @@ export const editAssetItem = (options: {
const linkAddress = options.content;
const type = options.type as "image" | "file";
const menu = new Menu("av-asset-edit", () => {
if (!textElements[0].value ||
(!textElements[1] && textElements[0].value === linkAddress) ||
if ((!textElements[1] && textElements[0].value === linkAddress) ||
(textElements[1] && textElements[0].value === linkAddress && textElements[1].value === options.name)) {
return;
}
Expand Down Expand Up @@ -285,7 +281,7 @@ ${window.siyuan.languages.title}
export const addAssetLink = (protyle: IProtyle, cellElements: HTMLElement[], target: HTMLElement, blockElement: Element) => {
const menu = new Menu("av-asset-link", () => {
const textElements = menu.element.querySelectorAll("textarea");
if (!textElements[0].value) {
if (!textElements[0].value && !textElements[1].value) {
return;
}
updateAssetCell({
Expand Down

0 comments on commit 407dd38

Please sign in to comment.