diff --git a/clefincode_chat/__init__.py b/clefincode_chat/__init__.py index 7459b19..19626ee 100644 --- a/clefincode_chat/__init__.py +++ b/clefincode_chat/__init__.py @@ -1 +1 @@ -__version__ = '1.3.907' \ No newline at end of file +__version__ = '1.3.908' \ No newline at end of file diff --git a/clefincode_chat/public/js/components/erpnext_chat_space.js b/clefincode_chat/public/js/components/erpnext_chat_space.js index 5edb2b7..1bad36c 100644 --- a/clefincode_chat/public/js/components/erpnext_chat_space.js +++ b/clefincode_chat/public/js/components/erpnext_chat_space.js @@ -90,6 +90,8 @@ export default class ChatSpace { this.topic_read_only = Boolean(opts.topic_read_only); this.chat_topic_status = opts.chat_topic_status || null; this.reply_to_message_name = null; + this.topicInactiveNoticeDismissed = false; + this.$topicInactiveNotice = null; this.pendingReplies = []; this.searchResults = []; this.currentSearchIndex = -1; @@ -2741,6 +2743,7 @@ async fetch_single_message(messageName) { await this.setup_messages(res.results || []); await this.setup_actions(); await this.applySavedActiveTopic(); + this.checkAndShowTopicInactiveNotice(); this.render(); } catch (error) { console.log(error); @@ -5138,6 +5141,48 @@ isDedicatedTopicContext() { ); } +checkAndShowTopicInactiveNotice() { + if (this.isDedicatedTopicContext()) return; + if (this.topicInactiveNoticeDismissed) return; + + const lastMsg = this.prevMessage; + if (!lastMsg) return; + + const topicName = lastMsg.chat_topic || lastMsg.topic || null; + if (!topicName) return; + + if (this.activeMessageTopic && String(this.activeMessageTopic) === String(topicName)) return; + + const topicSubject = lastMsg.chat_topic_subject || lastMsg.topic_subject || topicName; + this.showTopicInactiveNotice(topicSubject); +} + +showTopicInactiveNotice(topicSubject) { + const $notice = $(` +