diff --git a/package.json b/package.json index 6c4e143098..9964ea1e96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.8-rc.10", + "version": "12.119.0-calc.8-rc.11", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/messaging/index.vue b/packages/client/src/pages/messaging/index.vue index 7e9c58b961..13bdfcc01f 100644 --- a/packages/client/src/pages/messaging/index.vue +++ b/packages/client/src/pages/messaging/index.vue @@ -17,10 +17,10 @@ -
+
@@ -61,8 +61,8 @@ import 'swiper/scss/virtual'; const router = useRouter(); -let messages = $ref([]); -let connection = $ref(null); +// let messages = $ref([]); +// let connection = $ref(null); const tabs = ['dms', 'groups']; let tab = $ref(tabs[0]); @@ -100,31 +100,31 @@ const groupsPagination = { }, }; -function onMessage(message): void { - if (message.recipientId) { - messages = messages.filter(m => !( - (m.recipientId === message.recipientId && m.userId === message.userId) || - (m.recipientId === message.userId && m.userId === message.recipientId))); +// function onMessage(message): void { +// if (message.recipientId) { +// messages = messages.filter(m => !( +// (m.recipientId === message.recipientId && m.userId === message.userId) || +// (m.recipientId === message.userId && m.userId === message.recipientId))); - messages.unshift(message); - } else if (message.groupId) { - messages = messages.filter(m => m.groupId !== message.groupId); - messages.unshift(message); - } -} +// messages.unshift(message); +// } else if (message.groupId) { +// messages = messages.filter(m => m.groupId !== message.groupId); +// messages.unshift(message); +// } +// } -function onRead(ids): void { - for (const id of ids) { - const found = messages.find(m => m.id === id); - if (found) { - if (found.recipientId) { - found.isRead = true; - } else if (found.groupId) { - found.reads.push($i.id); - } - } - } -} +// function onRead(ids): void { +// for (const id of ids) { +// const found = messages.find(m => m.id === id); +// if (found) { +// if (found.recipientId) { +// found.isRead = true; +// } else if (found.groupId) { +// found.reads.push($i.id); +// } +// } +// } +// } async function startUser(): void { os.selectUser().then(user => { @@ -168,25 +168,25 @@ function syncSlide(index) { swiperRef.slideTo(index); } -onMounted(() => { - connection = markRaw(stream.useChannel('messagingIndex')); +// onMounted(() => { +// connection = markRaw(stream.useChannel('messagingIndex')); - connection.on('message', onMessage); - connection.on('read', onRead); +// connection.on('message', onMessage); +// connection.on('read', onRead); - os.api('messaging/history', { group: false, limit: 5 }).then(userMessages => { - os.api('messaging/history', { group: true, limit: 5 }).then(groupMessages => { - const _messages = userMessages.concat(groupMessages); - _messages.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()); - messages = _messages; - fetching = false; - }); - }); -}); +// os.api('messaging/history', { group: false, limit: 5 }).then(userMessages => { +// os.api('messaging/history', { group: true, limit: 5 }).then(groupMessages => { +// const _messages = userMessages.concat(groupMessages); +// _messages.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()); +// messages = _messages; +// fetching = false; +// }); +// }); +// }); -onUnmounted(() => { - if (connection) connection.dispose(); -}); +// onUnmounted(() => { +// if (connection) connection.dispose(); +// });