diff --git a/src/components/compose.jsx b/src/components/compose.jsx index c35d8913..aca29fde 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -93,11 +93,15 @@ function Compose({ replyToStatus.account.acct, ...replyToStatus.mentions.map((m) => m.acct), ]); - textareaRef.current.value = `${[...mentions] - .filter((m) => m !== currentAccountInfo.acct) // Excluding self - .map((m) => `@${m}`) - .join(' ')} `; - textareaRef.current.dispatchEvent(new Event('input')); + const allMentions = [...mentions].filter( + (m) => m !== currentAccountInfo.acct, + ); + if (allMentions.length > 0) { + textareaRef.current.value = `${allMentions + .map((m) => `@${m}`) + .join(' ')} `; + textareaRef.current.dispatchEvent(new Event('input')); + } textareaRef.current.focus(); } setVisibility(visibility); diff --git a/src/components/status.css b/src/components/status.css index 2be410d8..731dfb4d 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -294,6 +294,7 @@ } .status .media-audio { border: 0; + min-height: 0; } .status .media-audio audio { width: 100%; @@ -471,7 +472,7 @@ a.card:hover { .status .actions > button.plain.reblog-button:hover { color: var(--reblog-color); } -.status .actions > button.plain.reblog-button.reblogged { +.status .actions > button.plain.reblog-button.checked { color: var(--reblog-color); border-color: var(--reblog-color); } @@ -490,13 +491,13 @@ a.card:hover { opacity: 0; } } -.status .actions > button.plain.reblog-button.reblogged .icon { +.status .actions > button.plain.reblog-button.checked .icon { animation: reblogged 1s ease-in-out; } .status .actions > button.plain.favourite-button:hover { color: var(--favourite-color); } -.status .actions > button.plain.favourite-button.favourited { +.status .actions > button.plain.favourite-button.checked { color: var(--favourite-color); border-color: var(--favourite-color); } @@ -518,11 +519,11 @@ a.card:hover { opacity: 0; } } -.status .actions > button.plain.favourite-button.favourited .icon { +.status .actions > button.plain.favourite-button.checked .icon { transform-origin: bottom center; animation: hearted 1s ease-in-out; } -.status .actions > button.plain.bookmark-button.bookmarked { +.status .actions > button.plain.bookmark-button.checked { color: var(--link-color); border-color: var(--link-color); } @@ -544,7 +545,7 @@ a.card:hover { opacity: 1; } } -.status .actions > button.plain.bookmark-button.bookmarked .icon { +.status .actions > button.plain.bookmark-button.checked .icon { animation: bookmarked 1s ease-in-out; } diff --git a/src/components/status.jsx b/src/components/status.jsx index dc135046..d4457617 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -220,8 +220,10 @@ function Card({ card }) { height={height} loading="lazy" alt="" - onError={() => { - this.style.display = 'none'; + onError={(e) => { + try { + e.target.style.display = 'none'; + } catch (e) {} }} />
@@ -855,42 +857,35 @@ function Status({ )}
- + /> {/* TODO: if visibility = private, only can reblog own statuses */} {visibility !== 'direct' && ( - + /> )} - - + /> {isSelf && ( + ); +} + export default Status; diff --git a/src/index.css b/src/index.css index 72d2b77f..061c9f63 100644 --- a/src/index.css +++ b/src/index.css @@ -188,7 +188,7 @@ select.plain { pre code, code { - font-size: 95%; + font-size: 90%; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; } diff --git a/src/utils/enhance-content.js b/src/utils/enhance-content.js index 783bcffe..4783f3c3 100644 --- a/src/utils/enhance-content.js +++ b/src/utils/enhance-content.js @@ -20,7 +20,7 @@ function enhanceContent(content, opts = {}) { // Convert :shortcode: to let textNodes = extractTextNodes(dom); textNodes.forEach((node) => { - let html = node.nodeValue; + let html = node.nodeValue.replace(//g, '>'); if (emojis) { html = emojifyText(html, emojis); } @@ -34,7 +34,7 @@ function enhanceContent(content, opts = {}) { // Convert `code` to code textNodes = extractTextNodes(dom); textNodes.forEach((node) => { - let html = node.nodeValue; + let html = node.nodeValue.replace(//g, '>'); if (/`[^`]+`/g.test(html)) { html = html.replaceAll(/(`[^]+?`)/g, '$1'); }