Improve room join/leave

This commit is contained in:
Jon Staab
2024-09-11 12:19:45 -07:00
parent e9cbfec76d
commit e0eb37cd04
10 changed files with 108 additions and 41 deletions
-1
View File
@@ -81,7 +81,6 @@
onMount(() => {
editor = createEditor(getChatViewOptions(event.content))
console.log($editor)
})
</script>
+1 -1
View File
@@ -6,7 +6,7 @@ export const makeSpacePath = (url: string, extra = "") => {
let path = `/spaces/${nip19.nrelayEncode(url)}`
if (extra) {
path += "/" + extra
path += "/" + encodeURIComponent(extra)
}
return path
+14 -4
View File
@@ -69,10 +69,6 @@ export const deriveEvent = (idOrAddress: string, hints: string[] = []) => {
)
}
// Topics
export const topicsByUrl = withGetter(writable(new Map<string, string[]>()))
// Membership
export type Membership = {
@@ -185,6 +181,20 @@ export const {
},
})
// Topics
export const topicsByUrl = derived(chats, $chats => {
const $topicsByUrl = new Map<string, string[]>()
for (const chat of $chats) {
if (chat.topic) {
pushToMapKey($topicsByUrl, chat.url, chat.topic)
}
}
return $topicsByUrl
})
// User stuff
export const userProfile = derived([pubkey, profilesByPubkey], ([$pubkey, $profilesByPubkey]) => {