forked from coracle/flotilla
Join default spaces on signup
This commit is contained in:
@@ -22,8 +22,10 @@
|
||||
INDEXER_RELAYS,
|
||||
DEFAULT_RELAYS,
|
||||
DEFAULT_MESSAGING_RELAYS,
|
||||
DEFAULT_SPACES,
|
||||
} from "@app/env"
|
||||
import {setChecked} from "@app/notifications"
|
||||
import {setSpaces} from "@app/groups"
|
||||
import {loginWithPomade} from "@app/pomade"
|
||||
import {pushModal, clearModals} from "@app/modal"
|
||||
|
||||
@@ -52,6 +54,9 @@
|
||||
// Save the user's profile
|
||||
initProfile(getKey<Profile>("signup.profile")!)
|
||||
|
||||
// Auto-join default spaces
|
||||
setSpaces(DEFAULT_SPACES)
|
||||
|
||||
// Don't show any notifications for old content
|
||||
setChecked("*")
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ export const POMADE_SIGNERS = fromCsv(import.meta.env.VITE_POMADE_SIGNERS)
|
||||
|
||||
export const DEFAULT_BLOSSOM_SERVERS = fromCsv(import.meta.env.VITE_DEFAULT_BLOSSOM_SERVERS)
|
||||
|
||||
export const DEFAULT_SPACES = fromCsv(import.meta.env.VITE_DEFAULT_SPACES).map(normalizeRelayUrl)
|
||||
|
||||
export const DEFAULT_PUBKEYS = import.meta.env.VITE_DEFAULT_PUBKEYS
|
||||
|
||||
export const DUFFLEPUD_URL = "https://dufflepud.onrender.com"
|
||||
|
||||
+1
-1
@@ -311,7 +311,7 @@ export const removeSpace = async (url: string) => {
|
||||
return publishThunk({event, relays})
|
||||
}
|
||||
|
||||
export const setSpaceOrder = async (urls: string[]) => {
|
||||
export const setSpaces = async (urls: string[]) => {
|
||||
const list = get(userGroupList) || makeList({kind: ROOMS})
|
||||
const orderedUrls = uniq(urls.map(normalizeRelayUrl))
|
||||
const relayTags = list.publicTags.filter(t => t[0] === "r")
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
import SpaceAdd from "@app/components/SpaceAdd.svelte"
|
||||
import SpaceInviteAccept from "@app/components/SpaceInviteAccept.svelte"
|
||||
import SpaceJoin from "@app/components/SpaceJoin.svelte"
|
||||
import {userSpaceUrls, loadUserGroupList, groupListPubkeysByUrl, setSpaceOrder} from "@app/groups"
|
||||
import {userSpaceUrls, loadUserGroupList, groupListPubkeysByUrl, setSpaces} from "@app/groups"
|
||||
import {PLATFORM_RELAYS, DEFAULT_RELAYS} from "@app/env"
|
||||
import {bootstrapPubkeys} from "@app/social"
|
||||
import {parseInviteLink} from "@app/invites"
|
||||
@@ -128,7 +128,7 @@
|
||||
lastDragTarget = undefined
|
||||
|
||||
if (dragStartOrder && !isSameOrder(dragStartOrder, orderedSpaceUrls)) {
|
||||
void setSpaceOrder(orderedSpaceUrls).catch(console.error)
|
||||
void setSpaces(orderedSpaceUrls).catch(console.error)
|
||||
}
|
||||
|
||||
dragStartOrder = undefined
|
||||
|
||||
Reference in New Issue
Block a user