forked from coracle/flotilla
Update pomade version
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
|
||||
return pushToast({
|
||||
theme: "error",
|
||||
message: `Failed to recover: ${request.messages[0]?.payload.message.toLowerCase()}`,
|
||||
message: `Failed to recover: ${request.messages[0]?.res?.message.toLowerCase()}`,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
return pushToast({
|
||||
theme: "error",
|
||||
message: `Failed to recover: ${result.messages[0]?.payload.message.toLowerCase()}`,
|
||||
message: `Failed to recover: ${result.messages[0]?.res?.message.toLowerCase()}`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -17,35 +17,28 @@
|
||||
if (!isPomadeSession($session)) return
|
||||
|
||||
const client = new Client($session.clientOptions)
|
||||
const result = await client.listSessions()
|
||||
const pubkey = await client.getPubkey()
|
||||
|
||||
try {
|
||||
const result = await client.listSessions()
|
||||
const pubkey = await client.getPubkey()
|
||||
if (result.ok) {
|
||||
// Group sessions by client pubkey and collect peers
|
||||
const sessionMap = new Map<string, SessionWithPeers>()
|
||||
|
||||
if (result.ok) {
|
||||
// Group sessions by client pubkey and collect peers
|
||||
const sessionMap = new Map<string, SessionWithPeers>()
|
||||
for (const message of result.messages) {
|
||||
if (!message.res?.items) continue
|
||||
|
||||
for (const message of result.messages) {
|
||||
if (!message?.payload.items) continue
|
||||
for (const item of message.res.items) {
|
||||
const existing = sessionMap.get(item.client)
|
||||
|
||||
const peer = message.event.pubkey
|
||||
|
||||
for (const item of message.payload.items) {
|
||||
const existing = sessionMap.get(item.client)
|
||||
|
||||
if (existing) {
|
||||
existing.peers.push(peer)
|
||||
} else if (item.client !== pubkey) {
|
||||
sessionMap.set(item.client, {...item, peers: [peer]})
|
||||
}
|
||||
if (existing) {
|
||||
existing.peers.push(message.url)
|
||||
} else if (item.client !== pubkey) {
|
||||
sessionMap.set(item.client, {...item, peers: [message.url]})
|
||||
}
|
||||
}
|
||||
|
||||
sessions = Array.from(sessionMap.values())
|
||||
}
|
||||
} finally {
|
||||
client.stop()
|
||||
|
||||
sessions = Array.from(sessionMap.values())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +64,6 @@
|
||||
message: "Failed to delete session",
|
||||
})
|
||||
}
|
||||
|
||||
client.stop()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
pushToast({
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
import type {Profile} from "@welshman/util"
|
||||
import {getTag, makeProfile} from "@welshman/util"
|
||||
import {pubkey, profilesByPubkey} from "@welshman/app"
|
||||
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import ProfileEditForm from "@app/components/ProfileEditForm.svelte"
|
||||
import {clearModals} from "@app/util/modal"
|
||||
@@ -24,9 +26,10 @@
|
||||
|
||||
<ProfileEditForm {initialValues} {onsubmit}>
|
||||
{#snippet footer()}
|
||||
<div class="mt-4 flex flex-row items-center justify-between gap-4">
|
||||
<Button class="btn btn-neutral" onclick={back}>Discard Changes</Button>
|
||||
<Button type="submit" class="btn btn-primary">Save Changes</Button>
|
||||
</div>
|
||||
<Button class="btn btn-link" onclick={back}>
|
||||
<Icon icon={AltArrowLeft} />
|
||||
Go Back
|
||||
</Button>
|
||||
<Button type="submit" class="btn btn-primary">Save Changes</Button>
|
||||
{/snippet}
|
||||
</ProfileEditForm>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Modal from "@lib/components/Modal.svelte"
|
||||
import ModalBody from "@lib/components/ModalBody.svelte"
|
||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||
import InputProfilePicture from "@app/components/InputProfilePicture.svelte"
|
||||
import InfoHandle from "@app/components/InfoHandle.svelte"
|
||||
import {pushModal} from "@app/util/modal"
|
||||
@@ -123,5 +124,7 @@
|
||||
</FieldInline>
|
||||
{/if}
|
||||
</ModalBody>
|
||||
{@render footer()}
|
||||
<ModalFooter>
|
||||
{@render footer()}
|
||||
</ModalFooter>
|
||||
</Modal>
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
|
||||
loading = true
|
||||
|
||||
let client: Client | undefined = undefined
|
||||
|
||||
try {
|
||||
const secret = getKey<string>("signup.secret")!
|
||||
const {clientOptions, ...registerRes} = await Client.register(2, 3, secret)
|
||||
@@ -52,12 +50,11 @@
|
||||
})
|
||||
}
|
||||
|
||||
client = new Client(clientOptions)
|
||||
|
||||
const client = new Client(clientOptions)
|
||||
const setupRes = await client.setupRecovery(email, password)
|
||||
|
||||
if (!setupRes.ok) {
|
||||
const message = setupRes.messages[0]?.payload.message || "Please try again."
|
||||
const message = setupRes.messages[0]?.res?.message || "Please try again."
|
||||
|
||||
return pushToast({
|
||||
theme: "error",
|
||||
@@ -86,7 +83,6 @@
|
||||
message: "Failed to register! Please try again.",
|
||||
})
|
||||
} finally {
|
||||
client?.stop()
|
||||
loading = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Modal from "@lib/components/Modal.svelte"
|
||||
import ModalBody from "@lib/components/ModalBody.svelte"
|
||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||
import ProfileEditForm from "@app/components/ProfileEditForm.svelte"
|
||||
|
||||
type Props = {
|
||||
@@ -32,16 +31,14 @@
|
||||
<ModalBody>
|
||||
<ProfileEditForm isSignup {initialValues} {onsubmit}>
|
||||
{#snippet footer()}
|
||||
<ModalFooter>
|
||||
<Button class="btn btn-link" onclick={back}>
|
||||
<Icon icon={AltArrowLeft} />
|
||||
Go back
|
||||
</Button>
|
||||
<Button class="btn btn-primary" type="submit">
|
||||
Create Account
|
||||
<Icon icon={AltArrowRight} />
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
<Button class="btn btn-link" onclick={back}>
|
||||
<Icon icon={AltArrowLeft} />
|
||||
Go back
|
||||
</Button>
|
||||
<Button class="btn btn-primary" type="submit">
|
||||
Create Account
|
||||
<Icon icon={AltArrowRight} />
|
||||
</Button>
|
||||
{/snippet}
|
||||
</ProfileEditForm>
|
||||
</ModalBody>
|
||||
|
||||
Reference in New Issue
Block a user