diff --git a/src/routes/_components/compose/ComposeAuthor.html b/src/routes/_components/compose/ComposeAuthor.html index ccd519b..d9b0c27 100644 --- a/src/routes/_components/compose/ComposeAuthor.html +++ b/src/routes/_components/compose/ComposeAuthor.html @@ -1,16 +1,20 @@ + aria-hidden={true} + on:click="onClick(event)" +> + rel="prefetch" + on:click="onClick(event)" +> + {'@' + verifyCredentials.acct} @@ -64,8 +68,9 @@ import Avatar from '../Avatar.html' import { store } from '../../_store/store' import AccountDisplayName from '../profile/AccountDisplayName.html' - import { removeEmoji } from '../../_utils/removeEmoji' import { ONE_TRANSPARENT_PIXEL } from '../../_static/media' + import { emit } from '../../_utils/eventBus' + import { goto } from '../../../../__sapper__/client' export default { components: { @@ -86,14 +91,20 @@ } }, id: ({ verifyCredentials }) => (verifyCredentials && verifyCredentials.id), - href: ({ id }) => (id ? `/accounts/${id}` : '#'), - emojis: ({ verifyCredentials }) => (verifyCredentials.emojis || []), - displayName: ({ verifyCredentials }) => verifyCredentials.display_name || verifyCredentials.username || '', - accessibleName: ({ displayName, emojis, $omitEmojiInDisplayNames }) => { - if ($omitEmojiInDisplayNames) { - return removeEmoji(displayName, emojis) || displayName + href: ({ id }) => (id ? `/accounts/${id}` : '#') + }, + methods: { + onClick (e) { + let { realm, dialogId, href } = this.get() + if (realm === 'dialog') { + e.preventDefault() + e.stopPropagation() + // in dialog mode, we have to close the dialog and then navigate to the profile + emit('closeDialog', dialogId) + setTimeout(() => { // setTimeout to work around dialog navigation issues + goto(href) + }) } - return displayName } } } diff --git a/src/routes/_components/compose/ComposeBox.html b/src/routes/_components/compose/ComposeBox.html index 20487c0..ef775a5 100644 --- a/src/routes/_components/compose/ComposeBox.html +++ b/src/routes/_components/compose/ComposeBox.html @@ -3,7 +3,7 @@ {/if}
- + {#if contentWarningShown}
@@ -120,7 +120,8 @@ isReply: false, autoFocus: false, hideBottomBorder: false, - hidden: false + hidden: false, + dialogId: void 0 }), store: () => store, computed: { diff --git a/src/routes/_components/dialog/components/ComposeDialog.html b/src/routes/_components/dialog/components/ComposeDialog.html index 78415fc..be98e51 100644 --- a/src/routes/_components/dialog/components/ComposeDialog.html +++ b/src/routes/_components/dialog/components/ComposeDialog.html @@ -4,7 +4,7 @@ {title} background="var(--main-bg)" > - +