mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-17 05:36:36 +02:00
Fix image viewer with back button, join message spacing
This commit is contained in:
parent
7b24050de9
commit
d42232ab77
|
@ -98,16 +98,6 @@ export default defineComponent({
|
|||
link.value = null;
|
||||
};
|
||||
|
||||
onBeforeRouteLeave((to, from, next) => {
|
||||
next();
|
||||
|
||||
// cancel the navigation if the user is trying to close the image viewer
|
||||
if (link.value) {
|
||||
closeViewer();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
const setPrevNextImages = () => {
|
||||
if (!channel.value || !link.value) {
|
||||
return null;
|
||||
|
|
|
@ -142,6 +142,7 @@ import {
|
|||
ref,
|
||||
watch,
|
||||
} from "vue";
|
||||
import {onBeforeRouteUpdate} from "vue-router";
|
||||
import eventbus from "../js/eventbus";
|
||||
import friendlysize from "../js/helpers/friendlysize";
|
||||
import {useStore} from "../js/store";
|
||||
|
@ -168,6 +169,16 @@ export default defineComponent({
|
|||
const isContentShown = ref(false);
|
||||
const imageViewer = inject(imageViewerKey);
|
||||
|
||||
onBeforeRouteUpdate((to, from, next) => {
|
||||
// cancel the navigation if the user is trying to close the image viewer
|
||||
if (imageViewer?.value?.link) {
|
||||
imageViewer.value.closeViewer();
|
||||
return next(false);
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
const content = ref<HTMLDivElement | null>(null);
|
||||
const container = ref<HTMLDivElement | null>(null);
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<span class="content">
|
||||
<Username :user="message.from" />
|
||||
<i class="hostmask"> (<ParsedMessage :network="network" :text="message.hostmask" />)</i>
|
||||
<i class="hostmask"> (<ParsedMessage :network="network" :text="message.hostmask" />) </i>
|
||||
<template v-if="message.account">
|
||||
<i class="account"> [{{ message.account }}]</i>
|
||||
<i class="account">[{{ message.account }}]</i>
|
||||
</template>
|
||||
<template v-if="message.gecos">
|
||||
<i class="realname"> {{ message.gecos }}</i>
|
||||
<i class="realname">{{ message.gecos }}</i>
|
||||
</template>
|
||||
has joined the channel
|
||||
</span>
|
||||
|
|
Loading…
Reference in a new issue