fix: approval queue loading timing and sync issues
- Fix GroupMembersPanel join requests not loading when navigating from homepage (onMounted timing issue), replaced with watch - Fix GroupView pending count not syncing after reject/approve, added requestHandled event communication between components - Update changelog with all v0.3.5 fixes and new features Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, onMounted, onUnmounted } from 'vue'
|
import { computed, ref, watch, onUnmounted } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { useGroupStore } from '@/stores/group'
|
import { useGroupStore } from '@/stores/group'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
@@ -18,6 +18,7 @@ import JoinRequestCard from './JoinRequestCard.vue'
|
|||||||
|
|
||||||
const groupStore = useGroupStore()
|
const groupStore = useGroupStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
const emit = defineEmits<{ requestHandled: [] }>()
|
||||||
|
|
||||||
const group = computed(() => groupStore.currentGroup)
|
const group = computed(() => groupStore.currentGroup)
|
||||||
const members = computed(() => groupStore.currentMembers)
|
const members = computed(() => groupStore.currentMembers)
|
||||||
@@ -33,14 +34,17 @@ const inviteLink = computed(() => {
|
|||||||
return `${window.location.origin}/join/group/${group.value.id}`
|
return `${window.location.origin}/join/group/${group.value.id}`
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
let subscribedGroupId = ''
|
||||||
if (group.value && canManage.value) {
|
|
||||||
|
watch(group, async (g) => {
|
||||||
|
if (g && canManage.value && g.id !== subscribedGroupId) {
|
||||||
|
subscribedGroupId = g.id
|
||||||
await loadJoinRequests()
|
await loadJoinRequests()
|
||||||
subscribeJoinRequests(group.value.id, () => {
|
subscribeJoinRequests(g.id, () => {
|
||||||
loadJoinRequests()
|
loadJoinRequests()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
}, { immediate: true })
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
// cleanup handled by PocketBase
|
// cleanup handled by PocketBase
|
||||||
@@ -125,6 +129,7 @@ async function onJoinRequestResponded(requestId: string) {
|
|||||||
if (group.value) {
|
if (group.value) {
|
||||||
await groupStore.setCurrentGroup(group.value.id)
|
await groupStore.setCurrentGroup(group.value.id)
|
||||||
}
|
}
|
||||||
|
emit('requestHandled')
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleTransferOwnership(userId: string, username: string) {
|
async function handleTransferOwnership(userId: string, username: string) {
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ interface LogEntry {
|
|||||||
const logs = ref<LogEntry[]>([
|
const logs = ref<LogEntry[]>([
|
||||||
{
|
{
|
||||||
version: 'v0.3.5',
|
version: 'v0.3.5',
|
||||||
date: '2026-04-21',
|
date: '2026-04-23',
|
||||||
title: 'Bug 修复与体验优化',
|
title: 'Bug 修复与体验优化',
|
||||||
items: [
|
items: [
|
||||||
|
{ type: 'feat', text: '群组页面顶部新增待审核入群申请徽章(脉冲动画提示),点击可滚动定位到审核列表' },
|
||||||
|
{ type: 'feat', text: '个人中心新增"我的入群申请"记录,展示申请状态、时间和拒绝原因' },
|
||||||
|
{ type: 'fix', text: '修复群组审核队列从首页进入时不显示的问题,改用 watch 监听群组数据加载' },
|
||||||
|
{ type: 'fix', text: '修复拒绝入群申请后标题区待审核计数不同步更新的问题' },
|
||||||
{ type: 'fix', text: '修复邀请链接复制在 HTTP 环境下报错的问题,添加 execCommand 降级方案' },
|
{ type: 'fix', text: '修复邀请链接复制在 HTTP 环境下报错的问题,添加 execCommand 降级方案' },
|
||||||
{ type: 'fix', text: '修复小队邀请链接页面未加载用户群组数据,导致始终提示"需要先加入群组"' },
|
{ type: 'fix', text: '修复小队邀请链接页面未加载用户群组数据,导致始终提示"需要先加入群组"' },
|
||||||
{ type: 'fix', text: '修复加入群组页面 isMember 判断错误,使用了群组对象而非用户 ID' },
|
{ type: 'fix', text: '修复加入群组页面 isMember 判断错误,使用了群组对象而非用户 ID' },
|
||||||
|
|||||||
@@ -82,15 +82,19 @@ const statusColors: Record<string, string> = {
|
|||||||
away: 'var(--gg-text-muted)'
|
away: 'var(--gg-text-muted)'
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
async function refreshPendingRequests() {
|
||||||
await groupStore.setCurrentGroup(groupId)
|
|
||||||
|
|
||||||
// 加载待审核入群申请(管理员可见)
|
|
||||||
if (canManage.value) {
|
if (canManage.value) {
|
||||||
try {
|
try {
|
||||||
pendingJoinRequests.value = await getGroupJoinRequests(groupId)
|
pendingJoinRequests.value = await getGroupJoinRequests(groupId)
|
||||||
} catch { /* ignore */ }
|
} catch { /* ignore */ }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await groupStore.setCurrentGroup(groupId)
|
||||||
|
|
||||||
|
// 加载待审核入群申请(管理员可见)
|
||||||
|
await refreshPendingRequests()
|
||||||
|
|
||||||
// 订阅用户状态变更
|
// 订阅用户状态变更
|
||||||
unsubFns.push(await pb.collection('users').subscribe('*', () => {
|
unsubFns.push(await pb.collection('users').subscribe('*', () => {
|
||||||
@@ -296,7 +300,7 @@ function scrollToRequests() {
|
|||||||
|
|
||||||
<!-- 右列: 群组成员管理面板 -->
|
<!-- 右列: 群组成员管理面板 -->
|
||||||
<aside class="right-col">
|
<aside class="right-col">
|
||||||
<GroupMembersPanel />
|
<GroupMembersPanel @request-handled="refreshPendingRequests" />
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|||||||
Reference in New Issue
Block a user