fix bugs with marquee
This commit is contained in:
Vendored
+6
-4
@@ -1298,7 +1298,7 @@
|
|||||||
this.connectionModel = connectionModel2;
|
this.connectionModel = connectionModel2;
|
||||||
this.chatListModel = chatListModel2;
|
this.chatListModel = chatListModel2;
|
||||||
this.fileTransferModel = fileTransferModel2;
|
this.fileTransferModel = fileTransferModel2;
|
||||||
this.BUILD = "Build 26.09.22.D";
|
this.BUILD = "Build 26.09.22.E";
|
||||||
// CONTEXT
|
// CONTEXT
|
||||||
this.contextStack = /* @__PURE__ */ new Map();
|
this.contextStack = /* @__PURE__ */ new Map();
|
||||||
this.closeContext = (contextId, fromHistoryEvent = false) => {
|
this.closeContext = (contextId, fromHistoryEvent = false) => {
|
||||||
@@ -4683,18 +4683,19 @@
|
|||||||
const notification = this.createNotification(message);
|
const notification = this.createNotification(message);
|
||||||
const currentChat = this.chatListViewModel.selectedChat.value.chatModel.unwrappedPrimaryChannel;
|
const currentChat = this.chatListViewModel.selectedChat.value.chatModel.unwrappedPrimaryChannel;
|
||||||
const currentPage = this.chatListViewModel.selectedChat.value.selectedPage.value;
|
const currentPage = this.chatListViewModel.selectedChat.value.selectedPage.value;
|
||||||
if (notification.chat == currentChat && currentPage == "messages" /* Messages */)
|
if (notification.fullChannel == currentChat && currentPage == "messages" /* Messages */)
|
||||||
return;
|
return;
|
||||||
this.messagesInMarquee.push(notification);
|
this.messagesInMarquee.push(notification);
|
||||||
this.startLoop();
|
this.startLoop();
|
||||||
};
|
};
|
||||||
this.openNotification = () => {
|
this.openNotification = () => {
|
||||||
const notification = this.marquee.value;
|
const notification = this.marquee.value;
|
||||||
|
console.log(notification);
|
||||||
if (notification == void 0) return;
|
if (notification == void 0) return;
|
||||||
const chat = [
|
const chat = [
|
||||||
...this.chatListViewModel.chatViewModels.value.values()
|
...this.chatListViewModel.chatViewModels.value.values()
|
||||||
].find(
|
].find(
|
||||||
(chat2) => chat2.chatModel.unwrappedPrimaryChannel == notification.chat
|
(chat2) => chat2.chatModel.unwrappedPrimaryChannel == notification.fullChannel
|
||||||
);
|
);
|
||||||
if (!chat) return;
|
if (!chat) return;
|
||||||
chat.open();
|
chat.open();
|
||||||
@@ -4734,6 +4735,7 @@
|
|||||||
return {
|
return {
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
chat,
|
chat,
|
||||||
|
fullChannel,
|
||||||
sender: message.sender,
|
sender: message.sender,
|
||||||
body: message.body
|
body: message.body
|
||||||
};
|
};
|
||||||
@@ -4815,7 +4817,7 @@
|
|||||||
// utility
|
// utility
|
||||||
this.stripNamespace = (fullChannel) => {
|
this.stripNamespace = (fullChannel) => {
|
||||||
for (const vm of this.chatViewModels.value) {
|
for (const vm of this.chatViewModels.value) {
|
||||||
const fullReference = vm.chatModel.info.namespace + vm.chatModel.info.primaryChannel;
|
const fullReference = vm.chatModel.unwrappedPrimaryChannel;
|
||||||
if (fullReference == fullChannel) return vm.chatModel.info.primaryChannel;
|
if (fullReference == fullChannel) return vm.chatModel.info.primaryChannel;
|
||||||
}
|
}
|
||||||
return fullChannel;
|
return fullChannel;
|
||||||
|
|||||||
Binary file not shown.
@@ -106,7 +106,7 @@ export default class ChatListViewModel {
|
|||||||
// utility
|
// utility
|
||||||
stripNamespace = (fullChannel: string): string => {
|
stripNamespace = (fullChannel: string): string => {
|
||||||
for (const vm of this.chatViewModels.value) {
|
for (const vm of this.chatViewModels.value) {
|
||||||
const fullReference = vm.chatModel.info.namespace + vm.chatModel.info.primaryChannel;
|
const fullReference = vm.chatModel.unwrappedPrimaryChannel;
|
||||||
if (fullReference == fullChannel) return vm.chatModel.info.primaryChannel;
|
if (fullReference == fullChannel) return vm.chatModel.info.primaryChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -9,7 +9,7 @@ import ConnectionModel from "../../Model/Global/connectionModel";
|
|||||||
import ChatListModel from "../../Model/Chat/chatListModel";
|
import ChatListModel from "../../Model/Chat/chatListModel";
|
||||||
|
|
||||||
export default class CoreViewModel {
|
export default class CoreViewModel {
|
||||||
readonly BUILD = "Build 26.09.22.D";
|
readonly BUILD = "Build 26.09.22.E";
|
||||||
|
|
||||||
translations: Translations;
|
translations: Translations;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default class NotificationViewModel {
|
|||||||
const currentPage =
|
const currentPage =
|
||||||
this.chatListViewModel.selectedChat.value.selectedPage.value;
|
this.chatListViewModel.selectedChat.value.selectedPage.value;
|
||||||
if (
|
if (
|
||||||
notification.chat == currentChat &&
|
notification.fullChannel == currentChat &&
|
||||||
currentPage == ChatPageTypes.Messages
|
currentPage == ChatPageTypes.Messages
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
@@ -35,13 +35,14 @@ export default class NotificationViewModel {
|
|||||||
|
|
||||||
openNotification = () => {
|
openNotification = () => {
|
||||||
const notification: Notification | undefined = this.marquee.value;
|
const notification: Notification | undefined = this.marquee.value;
|
||||||
|
console.log(notification);
|
||||||
if (notification == undefined) return;
|
if (notification == undefined) return;
|
||||||
|
|
||||||
const chat = [
|
const chat = [
|
||||||
...this.chatListViewModel.chatViewModels.value.values(),
|
...this.chatListViewModel.chatViewModels.value.values(),
|
||||||
].find(
|
].find(
|
||||||
(chat) =>
|
(chat) =>
|
||||||
chat.chatModel.unwrappedPrimaryChannel == notification.chat,
|
chat.chatModel.unwrappedPrimaryChannel == notification.fullChannel,
|
||||||
);
|
);
|
||||||
if (!chat) return;
|
if (!chat) return;
|
||||||
chat.open();
|
chat.open();
|
||||||
@@ -91,6 +92,7 @@ export default class NotificationViewModel {
|
|||||||
return {
|
return {
|
||||||
messageId: message.id,
|
messageId: message.id,
|
||||||
chat,
|
chat,
|
||||||
|
fullChannel,
|
||||||
sender: message.sender,
|
sender: message.sender,
|
||||||
body: message.body,
|
body: message.body,
|
||||||
};
|
};
|
||||||
@@ -100,6 +102,7 @@ export default class NotificationViewModel {
|
|||||||
export interface Notification {
|
export interface Notification {
|
||||||
messageId: string;
|
messageId: string;
|
||||||
chat: string;
|
chat: string;
|
||||||
|
fullChannel: string;
|
||||||
sender: string;
|
sender: string;
|
||||||
body: string;
|
body: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user