Fix deleted rooms persisting in navigation #285
@@ -122,6 +122,7 @@
|
||||
repository.removeEvent(thunk.event.id)
|
||||
pushToast({theme: "error", message})
|
||||
} else {
|
||||
await removeRoomMembership(url, h)
|
||||
goto(makeSpacePath(url))
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ import {derived, readable, writable} from "svelte/store"
|
||||
import * as nip19 from "nostr-tools/nip19"
|
||||
import {
|
||||
on,
|
||||
gt,
|
||||
gte,
|
||||
max,
|
||||
spec,
|
||||
call,
|
||||
@@ -620,7 +620,7 @@ export const roomsByUrl = derived(roomMetaEventsByIdByUrl, roomMetaEventsByIdByU
|
||||
for (const event of metaEvents) {
|
||||
const meta = tryCatch(() => readRoomMeta(event))
|
||||
|
|
||||
|
||||
if (!meta || gt(deletedByH.get(meta.h), meta.event.created_at)) {
|
||||
if (!meta || gte(deletedByH.get(meta.h), meta.event.created_at)) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -651,7 +651,10 @@ export const loadRoom = call(() => {
|
||||
|
||||
await load({
|
||||
relays: [url],
|
||||
filters: [{kinds: [ROOM_META], "#d": [h]}],
|
||||
filters: [
|
||||
{kinds: [ROOM_META], "#d": [h]},
|
||||
{kinds: [ROOM_DELETE], "#h": [h]},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
|
hodlbod
commented
It looks like this is the only substantial change, does this fix it on its own? It looks like this is the only substantial change, does this fix it on its own?
userAdityaa
commented
It seems to be fixed now. Could you please confirm from your side as well? > It looks like this is the only substantial change, does this fix it on its own?
It seems to be fixed now. Could you please confirm from your side as well?
|
||||
|
||||
Reference in New Issue
Block a user
this is unnecessary, deletes are already in roomMetaEventsByUrl right?
It’s already there, but after deleting a room and refreshing, the deletion took a second to reflect.
so I did this to avoid the user noticing that delay even for a moment.
let me attach a video for it.
I see, the roomMetaEventsByIdByUrl isn't populated until the event is accepted by the relay? This should be something taken care of by welshman's thunk — it populates both repository and tracker optimistically when publishing. I would debug why that's not working rather than add this band-aid.
please focus on caravel from your side for now since it’s the priority. I’ll dig into this issue a bit more from my end.