diff options
| author | Henry Jameson <me@hjkos.com> | 2022-04-20 20:23:34 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-04-20 20:23:34 +0300 |
| commit | e388dbc168ae466e6745588df0498ee0036d6eb1 (patch) | |
| tree | d33e8bea242b8f8a345e28b304236081806440f2 | |
| parent | be8098e8ec41ffa909987ee5db990a8c349a9034 (diff) | |
| parent | 895eda3714e9977d931a5e4a0f215c304df021af (diff) | |
Merge branch 'fix-chat-errors' into threecolumn
* fix-chat-errors:
fix some chat errors/warnings that sometimes happen
Fix incorrect close of a status popover when clicking Expand inside it
fix tests
fix hashtags by explicitly putting attributes
| -rw-r--r-- | src/components/chat_title/chat_title.vue | 3 | ||||
| -rw-r--r-- | src/components/rich_content/rich_content.jsx | 7 | ||||
| -rw-r--r-- | src/components/status_body/status_body.vue | 10 | ||||
| -rw-r--r-- | test/unit/specs/components/rich_content.spec.js | 2 |
4 files changed, 13 insertions, 9 deletions
diff --git a/src/components/chat_title/chat_title.vue b/src/components/chat_title/chat_title.vue index e62c52b2..7f6aaaa4 100644 --- a/src/components/chat_title/chat_title.vue +++ b/src/components/chat_title/chat_title.vue @@ -14,10 +14,11 @@ /> </router-link> <RichContent + v-if="user" class="username" :title="'@'+(user && user.screen_name_ui)" :html="htmlTitle" - :emoji="user.emoji" + :emoji="user.emoji || []" /> </div> </template> diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx index 41e287e4..ca075270 100644 --- a/src/components/rich_content/rich_content.jsx +++ b/src/components/rich_content/rich_content.jsx @@ -28,6 +28,10 @@ import './rich_content.scss' */ export default { name: 'RichContent', + components: { + MentionsLine, + HashtagLink + }, props: { // Original html content html: { @@ -86,7 +90,8 @@ export default { if (!encounteredTextReverse) { lastTags.push(linkData) } - return <HashtagLink { ...linkData }/> + const { url, tag, content } = linkData + return <HashtagLink url={url} tag={tag} content={content}/> } const renderMention = (attrs, children) => { diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue index 24d842c2..976fe98c 100644 --- a/src/components/status_body/status_body.vue +++ b/src/components/status_body/status_body.vue @@ -15,14 +15,14 @@ :emoji="status.emojis" /> <button - v-if="longSubject && showingLongSubject" + v-show="longSubject && showingLongSubject" class="button-unstyled -link tall-subject-hider" @click.prevent="toggleShowingLongSubject" > {{ $t("status.hide_full_subject") }} </button> <button - v-else-if="longSubject" + v-show="longSubject && !showingLongSubject" class="button-unstyled -link tall-subject-hider" @click.prevent="toggleShowingLongSubject" > @@ -34,7 +34,7 @@ class="text-wrapper" > <button - v-if="hideTallStatus" + v-show="hideTallStatus" class="button-unstyled -link tall-status-hider" :class="{ '-focused': focused }" @click.prevent="toggleShowMore" @@ -54,7 +54,7 @@ /> <button - v-if="hideSubjectStatus" + v-show="hideSubjectStatus" class="button-unstyled -link cw-status-hider" @click.prevent="toggleShowMore" > @@ -85,7 +85,7 @@ /> </button> <button - v-if="showingMore && !fullContent" + v-show="showingMore && !fullContent" class="button-unstyled -link status-unhider" @click.prevent="toggleShowMore" > diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index a4920867..958fb997 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -308,10 +308,8 @@ describe('RichContent', () => { '<a href="http://macrochan.org/images/N/H/NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg" target="_blank">', 'NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg</a>', ' <hashtag-link-stub url="https://shitposter.club/tag/nou" content="#nou" tag="nou">', - '#nou', '</hashtag-link-stub>', ' <hashtag-link-stub url="https://shitposter.club/tag/screencap" content="#screencap" tag="screencap">', - '#screencap', '</hashtag-link-stub>', ' </p>' ].join('') |
