forked from coracle/flotilla
Improve room join/leave
This commit is contained in:
+14
-4
@@ -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]) => {
|
||||
|
||||
Reference in New Issue
Block a user