Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js
index a8699f0ba3..48a23924ad 100644
--- a/src/components/status_popover/status_popover.js
+++ b/src/components/status_popover/status_popover.js
@@ -1,69 +1,64 @@
import Popover from 'src/components/popover/popover.vue'
import { useStatusesStore } from 'src/stores/statuses.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
library.add(faCircleNotch)
const StatusPopover = {
name: 'StatusPopover',
props: {
statusId: String,
link: Boolean,
},
emits: ['navigate'],
data() {
return {
error: false,
}
},
computed: {
status() {
return useStatusesStore().allStatuses.get(this.statusId)
},
- statusLink() {
- return this.$router.resolve({
+ destination() {
+ return {
name: 'conversation',
params: { statusId: this.statusId },
- }).href
+ }
},
},
components: {
Popover,
},
methods: {
enter() {
if (!this.status) {
if (!this.statusId) {
this.error = true
return
}
useStatusesStore()
.fetchStatus(this.statusId)
.then(() => (this.error = false))
.catch(() => (this.error = true))
}
},
navigate() {
- if (this.link) {
- this.$router.push({
- name: 'conversation',
- params: { statusId: this.statusId },
- })
- } else {
+ if (!this.link) {
this.$emit('navigate', this.statusId)
}
},
},
watch: {
status(newStatus, oldStatus) {
if (newStatus !== oldStatus) {
this.$nextTick(() => this.$refs.popover.updateStyles())
}
},
},
}
export default StatusPopover
diff --git a/src/components/status_popover/status_popover.vue b/src/components/status_popover/status_popover.vue
index 43e9507e91..2eaa04a79a 100644
--- a/src/components/status_popover/status_popover.vue
+++ b/src/components/status_popover/status_popover.vue
@@ -1,73 +1,73 @@
<template>
<Popover
ref="popover"
popover-class="popover-default status-popover"
trigger="hover"
- :link="link"
- :href="link ? statusLink : undefined"
+ :router-link="link"
+ :to="link ? destination : undefined"
:stay-on-click="true"
:bound-to="{ x: 'container' }"
aria-haspopup="dialog"
@show="enter"
- @click.prevent="navigate"
+ @click="navigate"
v-bind="$attrs"
>
<template #trigger>
<slot />
</template>
<template #content>
<Status
v-if="status"
:is-preview="true"
:status-id="statusId"
:compact="true"
:ignore-mute="true"
/>
<div
v-else-if="error"
class="status-preview-no-content faint"
>
{{ $t('status.status_unavailable') }}
</div>
<div
v-else
class="status-preview-no-content"
>
<FAIcon
icon="circle-notch"
spin
size="2x"
/>
</div>
</template>
</Popover>
</template>
<script src="./status_popover.js"></script>
<style lang="scss">
/* popover styles load on-demand, so we need to override */
.status-popover.popover {
font-size: 1rem;
min-width: 15em;
max-width: 95%;
border-color: var(--border);
border-style: solid;
border-width: 1px;
/* TODO cleanup this */
.Status.Status {
border: none;
}
.status-preview-no-content {
padding: 1em;
text-align: center;
i {
font-size: 2em;
}
}
}
</style>

File Metadata

Mime Type
text/x-diff
Expires
Sat, Oct 31, 4:05 PM (20 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1801564
Default Alt Text
(3 KB)

Event Timeline