mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-09 03:27:32 +08:00
refactor: migrate placeholders to IconPark
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
<BasePlaceholder
|
||||
v-if="messages.length === 0"
|
||||
text="暂无会话,发送消息试试 🎉"
|
||||
icon="fas fa-inbox"
|
||||
icon="Inbox"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -351,9 +351,9 @@ onMounted(async () => {
|
||||
})
|
||||
|
||||
const subscribeToConversation = () => {
|
||||
if (!currentUser.value) return;
|
||||
if (!currentUser.value) return
|
||||
const destination = `/topic/conversation/${conversationId}`
|
||||
|
||||
|
||||
subscribe(destination, async (message) => {
|
||||
try {
|
||||
const parsedMessage = JSON.parse(message.body)
|
||||
@@ -370,12 +370,12 @@ const subscribeToConversation = () => {
|
||||
|
||||
await markConversationAsRead()
|
||||
await nextTick()
|
||||
|
||||
|
||||
if (isUserNearBottom.value) {
|
||||
scrollToBottomSmooth()
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to parse websocket message", e)
|
||||
console.error('Failed to parse websocket message', e)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -394,7 +394,7 @@ onActivated(async () => {
|
||||
await nextTick()
|
||||
scrollToBottomSmooth()
|
||||
updateNearBottom()
|
||||
|
||||
|
||||
if (isConnected.value) {
|
||||
// 如果已连接,重新订阅
|
||||
subscribeToConversation()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<div v-if="!loading && conversations.length === 0" class="empty-container">
|
||||
<BasePlaceholder v-if="conversations.length === 0" text="暂无会话" icon="fas fa-inbox" />
|
||||
<BasePlaceholder v-if="conversations.length === 0" text="暂无会话" icon="Inbox" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -73,7 +73,7 @@
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="channels.length === 0" class="empty-container">
|
||||
<BasePlaceholder text="暂无频道" icon="fas fa-inbox" />
|
||||
<BasePlaceholder text="暂无频道" icon="Inbox" />
|
||||
</div>
|
||||
<div
|
||||
v-for="ch in channels"
|
||||
@@ -273,9 +273,9 @@ onActivated(async () => {
|
||||
})
|
||||
|
||||
const subscribeToUserMessages = () => {
|
||||
if (!currentUser.value) return;
|
||||
if (!currentUser.value) return
|
||||
const destination = `/topic/user/${currentUser.value.id}/messages`
|
||||
|
||||
|
||||
subscribe(destination, (message) => {
|
||||
if (activeTab.value === 'messages') {
|
||||
fetchConversations()
|
||||
|
||||
Reference in New Issue
Block a user