Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b1e822d21 | ||
|
|
fa97ac0691 | ||
|
|
1a1f8c52b2 | ||
|
|
97301c3080 | ||
|
|
8a7a5ca8d7 | ||
|
|
04160c04cc | ||
|
|
29292fd99d | ||
|
|
baf1323ebd | ||
|
|
9cc6275c82 | ||
|
|
20dac9d77b | ||
|
|
a6c28c94d4 |
@@ -28,6 +28,7 @@
|
|||||||
:message="inReplyTo"
|
:message="inReplyTo"
|
||||||
:message-type="data.message_type"
|
:message-type="data.message_type"
|
||||||
:parent-has-attachments="hasAttachments"
|
:parent-has-attachments="hasAttachments"
|
||||||
|
@click="navigateToMessage"
|
||||||
/>
|
/>
|
||||||
<bubble-text
|
<bubble-text
|
||||||
v-if="data.content"
|
v-if="data.content"
|
||||||
@@ -519,6 +520,13 @@ export default {
|
|||||||
this.showBackgroundHighlight = false;
|
this.showBackgroundHighlight = false;
|
||||||
}, HIGHLIGHT_TIMER);
|
}, HIGHLIGHT_TIMER);
|
||||||
},
|
},
|
||||||
|
async navigateToMessage() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, {
|
||||||
|
messageId: this.inReplyToMessageId,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -377,12 +377,20 @@ export default {
|
|||||||
removeBusListeners() {
|
removeBusListeners() {
|
||||||
bus.$off(BUS_EVENTS.SCROLL_TO_MESSAGE, this.onScrollToMessage);
|
bus.$off(BUS_EVENTS.SCROLL_TO_MESSAGE, this.onScrollToMessage);
|
||||||
},
|
},
|
||||||
onScrollToMessage({ messageId = '' } = {}) {
|
async onScrollToMessage({ messageId = '' } = {}) {
|
||||||
|
if (messageId) {
|
||||||
|
await this.$store.dispatch('setActiveChat', {
|
||||||
|
data: this.currentChat,
|
||||||
|
after: messageId,
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const messageElement = document.getElementById('message' + messageId);
|
const messageElement = document.getElementById('message' + messageId);
|
||||||
if (messageElement) {
|
if (messageElement) {
|
||||||
this.isProgrammaticScroll = true;
|
this.isProgrammaticScroll = true;
|
||||||
messageElement.scrollIntoView({ behavior: 'smooth' });
|
messageElement.scrollIntoView();
|
||||||
this.fetchPreviousMessages();
|
this.fetchPreviousMessages();
|
||||||
} else {
|
} else {
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
v-if="shouldShowReplyToMessage"
|
v-if="shouldShowReplyToMessage"
|
||||||
:message="inReplyTo"
|
:message="inReplyTo"
|
||||||
@dismiss="resetReplyToMessage"
|
@dismiss="resetReplyToMessage"
|
||||||
|
@navigate-to-message="navigateToMessage"
|
||||||
/>
|
/>
|
||||||
<canned-response
|
<canned-response
|
||||||
v-if="showMentions && hasSlashCommand"
|
v-if="showMentions && hasSlashCommand"
|
||||||
@@ -1159,6 +1160,11 @@ export default {
|
|||||||
LocalStorage.deleteFromJsonStore(replyStorageKey, this.conversationId);
|
LocalStorage.deleteFromJsonStore(replyStorageKey, this.conversationId);
|
||||||
bus.$emit(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE);
|
bus.$emit(BUS_EVENTS.TOGGLE_REPLY_TO_MESSAGE);
|
||||||
},
|
},
|
||||||
|
navigateToMessage(messageId) {
|
||||||
|
bus.$emit(BUS_EVENTS.SCROLL_TO_MESSAGE, {
|
||||||
|
messageId,
|
||||||
|
});
|
||||||
|
},
|
||||||
onNewConversationModalActive(isActive) {
|
onNewConversationModalActive(isActive) {
|
||||||
// Issue is if the new conversation modal is open and we drag and drop the file
|
// Issue is if the new conversation modal is open and we drag and drop the file
|
||||||
// then the file is not getting attached to the new conversation modal
|
// then the file is not getting attached to the new conversation modal
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="reply-editor bg-slate-50 dark:bg-slate-800 rounded-md py-1 pl-2 pr-1 text-xs tracking-wide mt-2 flex items-center gap-1.5 -mx-2"
|
class="reply-editor bg-slate-50 dark:bg-slate-800 rounded-md py-1 pl-2 pr-1 text-xs tracking-wide mt-2 flex items-center gap-1.5 -mx-2 cursor-pointer"
|
||||||
|
@click="$emit('navigate-to-message', message.id)"
|
||||||
>
|
>
|
||||||
<fluent-icon class="flex-shrink-0 icon" icon="arrow-reply" size="14" />
|
<fluent-icon class="flex-shrink-0 icon" icon="arrow-reply" size="14" />
|
||||||
<div class="flex-grow gap-1 mt-px text-xs truncate">
|
<div class="flex-grow gap-1 mt-px text-xs truncate">
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="px-2 py-1.5 rounded-sm min-w-[10rem] mb-2"
|
class="px-2 py-1.5 -mx-2 rounded-sm min-w-[15rem] mb-2 cursor-pointer"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-slate-50 dark:bg-slate-600 dark:text-slate-50':
|
'bg-slate-50 dark:bg-slate-600 dark:text-slate-50':
|
||||||
messageType === MESSAGE_TYPE.INCOMING,
|
messageType === MESSAGE_TYPE.INCOMING,
|
||||||
'bg-woot-600 text-woot-50': messageType === MESSAGE_TYPE.OUTGOING,
|
'bg-woot-600 text-woot-50': messageType === MESSAGE_TYPE.OUTGOING,
|
||||||
'-mx-2': !parentHasAttachments,
|
'-mx-2': !parentHasAttachments,
|
||||||
}"
|
}"
|
||||||
|
@click="$emit('click')"
|
||||||
>
|
>
|
||||||
<message-preview
|
<message-preview
|
||||||
:message="message"
|
:message="message"
|
||||||
|
|||||||
@@ -160,10 +160,10 @@ const actions = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
async setActiveChat({ commit, dispatch }, { data, after }) {
|
async setActiveChat({ commit, dispatch }, { data, after, force = false }) {
|
||||||
commit(types.SET_CURRENT_CHAT_WINDOW, data);
|
commit(types.SET_CURRENT_CHAT_WINDOW, data);
|
||||||
commit(types.CLEAR_ALL_MESSAGES_LOADED);
|
commit(types.CLEAR_ALL_MESSAGES_LOADED);
|
||||||
if (data.dataFetched === undefined) {
|
if (data.dataFetched === undefined || force) {
|
||||||
try {
|
try {
|
||||||
await dispatch('fetchPreviousMessages', {
|
await dispatch('fetchPreviousMessages', {
|
||||||
after,
|
after,
|
||||||
|
|||||||
Reference in New Issue
Block a user