mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 19:46:42 +00:00
Fix pubkey/anon login
This commit is contained in:
parent
eed863143d
commit
2d45928e8c
@ -3,10 +3,7 @@
|
|||||||
- [ ] Fix memory usage
|
- [ ] Fix memory usage
|
||||||
- [x] Add table of user events, derive profile from this using `watch`.
|
- [x] Add table of user events, derive profile from this using `watch`.
|
||||||
- [x] Make zapper info more compact
|
- [x] Make zapper info more compact
|
||||||
- [ ] Migrate
|
- [ ] Person search doesn't find people on first load
|
||||||
- [ ] Test
|
|
||||||
- [ ] Test that relays/follows made as anon don't stomp user settings on login
|
|
||||||
- [ ] Test anonymous usage, public key only usage
|
|
||||||
- [ ] Fix re-connects
|
- [ ] Fix re-connects
|
||||||
- [ ] Show loading/success on zap invoice screen
|
- [ ] Show loading/success on zap invoice screen
|
||||||
- [ ] Fix iOS/safari/firefox
|
- [ ] Fix iOS/safari/firefox
|
||||||
|
@ -75,7 +75,7 @@ export default {
|
|||||||
|
|
||||||
profile.update(assoc("petnames", $petnames))
|
profile.update(assoc("petnames", $petnames))
|
||||||
|
|
||||||
if (profileCopy) {
|
if (keys.canSign()) {
|
||||||
return cmd.setPetnames($petnames).publish(profileCopy.relays)
|
return cmd.setPetnames($petnames).publish(profileCopy.relays)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -102,7 +102,7 @@ export default {
|
|||||||
|
|
||||||
profile.update(assoc("relays", $relays))
|
profile.update(assoc("relays", $relays))
|
||||||
|
|
||||||
if (profileCopy) {
|
if (keys.canSign()) {
|
||||||
return cmd.setRelays($relays).publish($relays)
|
return cmd.setRelays($relays).publish($relays)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -132,7 +132,7 @@ export default {
|
|||||||
|
|
||||||
profile.update(assoc("mutes", $mutes))
|
profile.update(assoc("mutes", $mutes))
|
||||||
|
|
||||||
if (profileCopy) {
|
if (keys.canSign()) {
|
||||||
return cmd.setMutes($mutes.map(slice(0, 2))).publish(profileCopy.relays)
|
return cmd.setMutes($mutes.map(slice(0, 2))).publish(profileCopy.relays)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
let showNewMessages = false
|
let showNewMessages = false
|
||||||
let cursor = new Cursor()
|
let cursor = new Cursor()
|
||||||
|
|
||||||
const {profile} = user
|
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
// Group messages so we're only showing the person once per chunk
|
// Group messages so we're only showing the person once per chunk
|
||||||
annotatedMessages = reverse(
|
annotatedMessages = reverse(
|
||||||
@ -54,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (!$profile) {
|
if (!user.getPubkey()) {
|
||||||
return navigate("/login")
|
return navigate("/login")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,6 @@
|
|||||||
<i class="fa fa-qrcode mr-2" /> Scan
|
<i class="fa fa-qrcode mr-2" /> Scan
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{#if $profile}
|
|
||||||
<li
|
<li
|
||||||
class={cx("relative", {
|
class={cx("relative", {
|
||||||
"cursor-pointer": $canPublish,
|
"cursor-pointer": $canPublish,
|
||||||
@ -84,7 +83,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
|
||||||
<li class="mx-3 my-4 h-px bg-medium" />
|
<li class="mx-3 my-4 h-px bg-medium" />
|
||||||
<li class="relative cursor-pointer">
|
<li class="relative cursor-pointer">
|
||||||
<a class="block px-4 py-2 transition-all hover:bg-accent" href="/relays">
|
<a class="block px-4 py-2 transition-all hover:bg-accent" href="/relays">
|
||||||
@ -94,7 +92,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{#if $profile}
|
{#if $profile.pubkey}
|
||||||
<li class="cursor-pointer">
|
<li class="cursor-pointer">
|
||||||
<a class="block px-4 py-2 transition-all hover:bg-accent" href="/keys">
|
<a class="block px-4 py-2 transition-all hover:bg-accent" href="/keys">
|
||||||
<i class="fa fa-key mr-2" /> Keys
|
<i class="fa fa-key mr-2" /> Keys
|
||||||
|
@ -22,14 +22,22 @@
|
|||||||
|
|
||||||
export let stage
|
export let stage
|
||||||
|
|
||||||
let relays = [
|
const {relays: userRelays, petnamePubkeys} = user
|
||||||
|
|
||||||
|
let relays =
|
||||||
|
$userRelays.length > 0
|
||||||
|
? $userRelays
|
||||||
|
: [
|
||||||
{url: "wss://nostr-pub.wellorder.net", write: true},
|
{url: "wss://nostr-pub.wellorder.net", write: true},
|
||||||
{url: "wss://nostr.zebedee.cloud", write: true},
|
{url: "wss://nostr.zebedee.cloud", write: true},
|
||||||
{url: "wss://nos.lol", write: true},
|
{url: "wss://nos.lol", write: true},
|
||||||
{url: "wss://brb.io", write: true},
|
{url: "wss://brb.io", write: true},
|
||||||
]
|
]
|
||||||
|
|
||||||
let follows = [
|
let follows =
|
||||||
|
$petnamePubkeys.length > 0
|
||||||
|
? $petnamePubkeys
|
||||||
|
: [
|
||||||
"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322", // hodlbod
|
"97c70a44366a6535c145b333f973ea86dfdc2d7a99da618c40c64705ad98e322", // hodlbod
|
||||||
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d", // fiatjaf
|
"3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d", // fiatjaf
|
||||||
"82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2", // jack
|
"82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2", // jack
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
import RelayCard from "src/partials/RelayCard.svelte"
|
import RelayCard from "src/partials/RelayCard.svelte"
|
||||||
import pool from "src/agent/pool"
|
import pool from "src/agent/pool"
|
||||||
import user from "src/agent/user"
|
import user from "src/agent/user"
|
||||||
|
import keys from "src/agent/keys"
|
||||||
import {loadAppData} from "src/app"
|
import {loadAppData} from "src/app"
|
||||||
|
|
||||||
export let relay
|
export let relay
|
||||||
@ -17,6 +18,8 @@
|
|||||||
let joined = false
|
let joined = false
|
||||||
|
|
||||||
const {relays, canPublish} = user
|
const {relays, canPublish} = user
|
||||||
|
const {method} = keys
|
||||||
|
const isPubkeyLogin = $method === "pubkey"
|
||||||
|
|
||||||
$: joined = find(propEq("url", relay.url), $relays)
|
$: joined = find(propEq("url", relay.url), $relays)
|
||||||
|
|
||||||
@ -47,8 +50,8 @@
|
|||||||
<RelayCard
|
<RelayCard
|
||||||
{relay}
|
{relay}
|
||||||
{theme}
|
{theme}
|
||||||
addRelay={!joined && $canPublish ? addRelay : null}
|
addRelay={!joined && !isPubkeyLogin ? addRelay : null}
|
||||||
removeRelay={joined && $relays.length > 1 && canPublish ? removeRelay : null}>
|
removeRelay={joined && $relays.length > 1 && !isPubkeyLogin ? removeRelay : null}>
|
||||||
<div slot="controls" class="flex justify-between gap-2">
|
<div slot="controls" class="flex justify-between gap-2">
|
||||||
{#if showControls && $canPublish}
|
{#if showControls && $canPublish}
|
||||||
<span>Publish to this relay?</span>
|
<span>Publish to this relay?</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user