forked from coracle/flotilla
Fix ContentMention display
This commit is contained in:
+7
-2
@@ -213,10 +213,15 @@ export const setInboxRelayPolicy = (url: string, enabled: boolean) => {
|
|||||||
|
|
||||||
// Relay access
|
// Relay access
|
||||||
|
|
||||||
|
export const attemptAuth = (url: string) =>
|
||||||
|
Pool.get()
|
||||||
|
.get(url)
|
||||||
|
.auth.attemptAuth(e => signer.get()?.sign(e))
|
||||||
|
|
||||||
export const checkRelayAccess = async (url: string, claim = "") => {
|
export const checkRelayAccess = async (url: string, claim = "") => {
|
||||||
const socket = Pool.get().get(url)
|
const socket = Pool.get().get(url)
|
||||||
|
|
||||||
await socket.auth.attemptAuth(e => signer.get()?.sign(e))
|
await attemptAuth(url)
|
||||||
|
|
||||||
const thunk = publishThunk({
|
const thunk = publishThunk({
|
||||||
event: makeEvent(AUTH_JOIN, {tags: [["claim", claim]]}),
|
event: makeEvent(AUTH_JOIN, {tags: [["claim", claim]]}),
|
||||||
@@ -274,7 +279,7 @@ export const checkRelayAuth = async (url: string, timeout = 3000) => {
|
|||||||
const socket = Pool.get().get(url)
|
const socket = Pool.get().get(url)
|
||||||
const okStatuses = [AuthStatus.None, AuthStatus.Ok]
|
const okStatuses = [AuthStatus.None, AuthStatus.Ok]
|
||||||
|
|
||||||
await socket.auth.attemptAuth(e => signer.get()?.sign(e))
|
await attemptAuth(url)
|
||||||
|
|
||||||
// Only raise an error if it's not a timeout.
|
// Only raise an error if it's not a timeout.
|
||||||
// If it is, odds are the problem is with our signer, not the relay
|
// If it is, odds are the problem is with our signer, not the relay
|
||||||
|
|||||||
@@ -22,9 +22,15 @@
|
|||||||
import Spinner from "@lib/components/Spinner.svelte"
|
import Spinner from "@lib/components/Spinner.svelte"
|
||||||
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
||||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||||
import {alerts, getMembershipUrls, userMembership, NOTIFIER_PUBKEY} from "@app/state"
|
import {
|
||||||
|
alerts,
|
||||||
|
getMembershipUrls,
|
||||||
|
userMembership,
|
||||||
|
NOTIFIER_PUBKEY,
|
||||||
|
NOTIFIER_RELAY,
|
||||||
|
} from "@app/state"
|
||||||
import {loadAlertStatuses, requestRelayClaims} from "@app/requests"
|
import {loadAlertStatuses, requestRelayClaims} from "@app/requests"
|
||||||
import {publishAlert} from "@app/commands"
|
import {publishAlert, attemptAuth} from "@app/commands"
|
||||||
import type {AlertParams} from "@app/commands"
|
import type {AlertParams} from "@app/commands"
|
||||||
import {platform, canSendPushNotifications, getPushInfo} from "@app/push"
|
import {platform, canSendPushNotifications, getPushInfo} from "@app/push"
|
||||||
import {pushToast} from "@app/toast"
|
import {pushToast} from "@app/toast"
|
||||||
@@ -134,7 +140,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we don't do this we'll get an event rejection
|
// If we don't do this we'll get an event rejection
|
||||||
await Pool.get().get(NOTIFIER_RELAY).auth.attemptAuth()
|
await attemptAuth(NOTIFIER_RELAY)
|
||||||
|
|
||||||
const thunk = await publishAlert(params)
|
const thunk = await publishAlert(params)
|
||||||
const error = await getThunkError(thunk)
|
const error = await getThunkError(thunk)
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {removeNil} from "@welshman/lib"
|
import {removeNil} from "@welshman/lib"
|
||||||
import type {ProfilePointer} from "@welshman/content"
|
import type {ProfilePointer} from "@welshman/content"
|
||||||
import {displayProfile} from "@welshman/util"
|
import {deriveProfileDisplay} from "@welshman/app"
|
||||||
import {deriveProfile} from "@welshman/app"
|
|
||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
import ProfileDetail from "@app/components/ProfileDetail.svelte"
|
import ProfileDetail from "@app/components/ProfileDetail.svelte"
|
||||||
import {pushModal} from "@app/modal"
|
import {pushModal} from "@app/modal"
|
||||||
@@ -14,11 +13,11 @@
|
|||||||
|
|
||||||
const {value, url}: Props = $props()
|
const {value, url}: Props = $props()
|
||||||
|
|
||||||
const profile = deriveProfile(value.pubkey, removeNil([url]))
|
const display = deriveProfileDisplay(value.pubkey, removeNil([url]))
|
||||||
|
|
||||||
const openProfile = () => pushModal(ProfileDetail, {pubkey: value.pubkey, url})
|
const openProfile = () => pushModal(ProfileDetail, {pubkey: value.pubkey, url})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button onclick={openProfile} class="link-content">
|
<Button onclick={openProfile} class="link-content">
|
||||||
@{displayProfile($profile)}
|
@{$display}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ self.addEventListener("push", e => {
|
|||||||
if (data?.event) {
|
if (data?.event) {
|
||||||
url += nip19.neventEncode({
|
url += nip19.neventEncode({
|
||||||
id: data.event.id,
|
id: data.event.id,
|
||||||
relays: data.relays || []
|
relays: data.relays || [],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user