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
This commit is contained in:
Henry Jameson 2022-04-20 20:23:34 +03:00
commit e388dbc168
4 changed files with 13 additions and 9 deletions

View file

@ -14,10 +14,11 @@
/> />
</router-link> </router-link>
<RichContent <RichContent
v-if="user"
class="username" class="username"
:title="'@'+(user && user.screen_name_ui)" :title="'@'+(user && user.screen_name_ui)"
:html="htmlTitle" :html="htmlTitle"
:emoji="user.emoji" :emoji="user.emoji || []"
/> />
</div> </div>
</template> </template>

View file

@ -28,6 +28,10 @@ import './rich_content.scss'
*/ */
export default { export default {
name: 'RichContent', name: 'RichContent',
components: {
MentionsLine,
HashtagLink
},
props: { props: {
// Original html content // Original html content
html: { html: {
@ -86,7 +90,8 @@ export default {
if (!encounteredTextReverse) { if (!encounteredTextReverse) {
lastTags.push(linkData) lastTags.push(linkData)
} }
return <HashtagLink { ...linkData }/> const { url, tag, content } = linkData
return <HashtagLink url={url} tag={tag} content={content}/>
} }
const renderMention = (attrs, children) => { const renderMention = (attrs, children) => {

View file

@ -15,14 +15,14 @@
:emoji="status.emojis" :emoji="status.emojis"
/> />
<button <button
v-if="longSubject && showingLongSubject" v-show="longSubject && showingLongSubject"
class="button-unstyled -link tall-subject-hider" class="button-unstyled -link tall-subject-hider"
@click.prevent="toggleShowingLongSubject" @click.prevent="toggleShowingLongSubject"
> >
{{ $t("status.hide_full_subject") }} {{ $t("status.hide_full_subject") }}
</button> </button>
<button <button
v-else-if="longSubject" v-show="longSubject && !showingLongSubject"
class="button-unstyled -link tall-subject-hider" class="button-unstyled -link tall-subject-hider"
@click.prevent="toggleShowingLongSubject" @click.prevent="toggleShowingLongSubject"
> >
@ -34,7 +34,7 @@
class="text-wrapper" class="text-wrapper"
> >
<button <button
v-if="hideTallStatus" v-show="hideTallStatus"
class="button-unstyled -link tall-status-hider" class="button-unstyled -link tall-status-hider"
:class="{ '-focused': focused }" :class="{ '-focused': focused }"
@click.prevent="toggleShowMore" @click.prevent="toggleShowMore"
@ -54,7 +54,7 @@
/> />
<button <button
v-if="hideSubjectStatus" v-show="hideSubjectStatus"
class="button-unstyled -link cw-status-hider" class="button-unstyled -link cw-status-hider"
@click.prevent="toggleShowMore" @click.prevent="toggleShowMore"
> >
@ -85,7 +85,7 @@
/> />
</button> </button>
<button <button
v-if="showingMore && !fullContent" v-show="showingMore && !fullContent"
class="button-unstyled -link status-unhider" class="button-unstyled -link status-unhider"
@click.prevent="toggleShowMore" @click.prevent="toggleShowMore"
> >

View file

@ -308,10 +308,8 @@ describe('RichContent', () => {
'<a href="http://macrochan.org/images/N/H/NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg" target="_blank">', '<a href="http://macrochan.org/images/N/H/NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg" target="_blank">',
'NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg</a>', 'NHCMDUXJPPZ6M3Z2CQ6D2EBRSWGE7MZY.jpg</a>',
' <hashtag-link-stub url="https://shitposter.club/tag/nou" content="#nou" tag="nou">', ' <hashtag-link-stub url="https://shitposter.club/tag/nou" content="#nou" tag="nou">',
'#nou',
'</hashtag-link-stub>', '</hashtag-link-stub>',
' <hashtag-link-stub url="https://shitposter.club/tag/screencap" content="#screencap" tag="screencap">', ' <hashtag-link-stub url="https://shitposter.club/tag/screencap" content="#screencap" tag="screencap">',
'#screencap',
'</hashtag-link-stub>', '</hashtag-link-stub>',
' </p>' ' </p>'
].join('') ].join('')