@@ -69,7 +69,7 @@ const wallUser = ref(null)
6969provide (" social-user" , wallUser)
7070
7171const wallIdFromRoute = computed (() => {
72- const raw = route .query .id
72+ const raw = route .query .uid
7373 if (! raw) return null
7474 const n = Number (raw)
7575 return Number .isFinite (n) && n > 0 ? n : null
@@ -85,12 +85,12 @@ const wallName = computed(() => {
8585const isWallLoading = computed (() => ! isOwnWallByRoute .value && ! wallName .value )
8686
8787const wallTitle = computed (() => {
88- if (isOwnWallByRoute .value ) return ' '
88+ if (isOwnWallByRoute .value ) return " "
8989 if (isWallLoading .value ) return ` ${ t (" Social wall" )} `
9090 return ` ${ t (" Wall of {0}" , [wallName .value ])} ` .trim ()
9191})
9292
93- // Remount children when wall id or filter changes (prevents stale state reuse)
93+ // Remount children when wall id or filter changes
9494const wallKey = computed (() => ` wall:${ wallIdFromRoute .value || " me" } :${ filterType .value || " all" } ` )
9595
9696async function loadWallUser () {
@@ -105,7 +105,7 @@ async function loadWallUser() {
105105 return
106106 }
107107
108- // Stub user to prevent null-access while loading.
108+ // Stub user to prevent null-access while loading
109109 wallUser .value = {
110110 id: targetId,
111111 " @id" : ` /api/users/${ targetId} ` ,
@@ -132,15 +132,19 @@ async function hasFriendship(meIri, wallIri) {
132132
133133 try {
134134 const [a , b ] = await Promise .all ([
135- axios .get (` ${ ENTRYPOINT } user_rel_users` , { params: { relationType: 3 , user: meIri, friend: wallIri } }),
136- axios .get (` ${ ENTRYPOINT } user_rel_users` , { params: { relationType: 3 , user: wallIri, friend: meIri } }),
135+ axios .get (` ${ ENTRYPOINT } user_rel_users` , {
136+ params: { relationType: 3 , user: meIri, friend: wallIri },
137+ }),
138+ axios .get (` ${ ENTRYPOINT } user_rel_users` , {
139+ params: { relationType: 3 , user: wallIri, friend: meIri },
140+ }),
137141 ])
138142
139143 const aCount = Array .isArray (a .data ? .[" hydra:member" ]) ? a .data [" hydra:member" ].length : 0
140144 const bCount = Array .isArray (b .data ? .[" hydra:member" ]) ? b .data [" hydra:member" ].length : 0
141145 return aCount + bCount > 0
142146 } catch (e) {
143- console .warn (" Friendship check failed; posting on other wall disabled." , e)
147+ console .warn (" Friendship check failed; posting disabled." , e)
144148 return false
145149 }
146150}
@@ -162,32 +166,18 @@ async function refreshOtherWallPermission() {
162166 return
163167 }
164168
165- // Reset immediately so UI doesn't reuse previous wall permission
166169 canWriteOnOtherWall .value = null
167170 const allowed = await hasFriendship (meIri, wallIri)
168171
169- // Ignore outdated results (race condition guard)
170- if (seq !== permissionSeq) {
171- console .debug (" Ignoring outdated friendship result (race condition)." )
172- return
173- }
172+ if (seq !== permissionSeq) return
173+ if (targetWallId !== wallIdFromRoute .value ) return
174174
175- // Also ensure we are still on the same wall
176- if (targetWallId !== wallIdFromRoute .value ) {
177- console .debug (" Ignoring friendship result: wall changed during request." )
178- return
179- }
180175 canWriteOnOtherWall .value = allowed
181176}
182177
183- watch (
184- [() => currentUserIri .value , () => wallIdFromRoute .value ],
185- () => {
186- canWriteOnOtherWall .value = isOwnWallByRoute .value ? null : null
187- refreshOtherWallPermission ()
188- },
189- { immediate: true },
190- )
178+ watch ([() => currentUserIri .value , () => wallIdFromRoute .value ], () => refreshOtherWallPermission (), {
179+ immediate: true ,
180+ })
191181
192182watch (
193183 () => route .query .filterType ,
@@ -216,16 +206,19 @@ function refreshPosts() {
216206
217207function filterMessages (type ) {
218208 const nextQuery = { ... route .query }
209+
219210 if (type === null ) {
220211 delete nextQuery .filterType
221212 } else {
222213 nextQuery .filterType = type
223214 }
215+
224216 router .push ({ path: " /social" , query: nextQuery })
225217}
226218
227219function tabClasses (type ) {
228220 const isActive = type ? filterType .value === type : ! filterType .value
221+
229222 return [
230223 " inline-flex items-center rounded-full border px-4 py-2 text-body-2 font-medium transition-colors duration-150" ,
231224 " focus:outline-none focus:ring-2 focus:ring-primary" ,
0 commit comments