Slightly tweak notifications function
This commit is contained in:
parent
72f2effda4
commit
1076e8531c
1 changed files with 5 additions and 7 deletions
|
|
@ -345,14 +345,12 @@ class CapacitorNotifications implements IPushAdapter {
|
||||||
String(hash(relay + key + device.get()))
|
String(hash(relay + key + device.get()))
|
||||||
|
|
||||||
_getPushUrl = async (url: string) => {
|
_getPushUrl = async (url: string) => {
|
||||||
let relay = await loadRelay(url)
|
for (const candidate of [url, PUSH_BRIDGE]) {
|
||||||
|
const relay = await loadRelay(candidate)
|
||||||
|
|
||||||
if (!relay?.self || !relay?.supported_nips?.map(String)?.includes("9a")) {
|
if (relay?.supported_nips?.map(String)?.includes("9a")) {
|
||||||
relay = await loadRelay(PUSH_BRIDGE)
|
return candidate
|
||||||
}
|
}
|
||||||
|
|
||||||
if (relay?.self) {
|
|
||||||
return relay.url
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue