Make network tab the default as much as possible

This commit is contained in:
Jonathan Staab 2023-01-21 12:16:27 -08:00
parent 07564ef29e
commit 072e092f8f
8 changed files with 17 additions and 13 deletions

View File

@ -206,7 +206,7 @@
</li>
{/if}
<li class="cursor-pointer">
<a class="block px-4 py-2 hover:bg-accent transition-all" href="/notes/global">
<a class="block px-4 py-2 hover:bg-accent transition-all" href="/notes/network">
<i class="fa-solid fa-tag mr-2" /> Notes
</a>
</li>

View File

@ -27,6 +27,9 @@ export const login = async ({privkey, pubkey}, usingExtension = false) => {
alerts.listen(getRelays(), pubkey),
messages.listen(getRelays(), pubkey)
// Not ideal, but the network tab depends on the user's social network being
// loaded, so put them on global when they first log in so we're not slowing
// down users' first run experience too much
navigate('/notes/global')
}

View File

@ -63,7 +63,7 @@ export const settings = synced("coracle/settings", {
// Wait for bugsnag to be started in main
setTimeout(() => {
Bugsnag.addOnError(event => {
if (window.location.host.startswith('localhost')) {
if (window.location.host.startsWith('localhost')) {
return false
}

View File

@ -150,7 +150,7 @@
</ul>
</div>
<div class="fixed z-10 top-16 w-full lg:-ml-56 lg:pl-56 border-b border-solid border-medium bg-dark">
<div class="p-4 flex gap-4">
<div class="p-4 flex items-start gap-4">
<div class="flex items-center gap-4">
<i class="fa fa-arrow-left text-2xl cursor-pointer" on:click={() => navigate("/chat")} />
<div

View File

@ -24,7 +24,7 @@
export let invertColors = false
let reply = null
let replyMentions = without([$user.pubkey], Tags.from(note).type("p").values().all())
let replyMentions = without([$user?.pubkey], Tags.from(note).type("p").values().all())
const links = $settings.showLinkPreviews ? extractUrls(note.content) || [] : null
const showEntire = anchorId === note.id

View File

@ -6,17 +6,18 @@
let confirmed = false
const confirm = () => {
const confirm = async () => {
confirmed = true
// Give them a moment to see the state transition
setTimeout(async () => {
localStorage.clear()
await db.delete()
localStorage.clear()
await db.delete()
// do a hard refresh so everything gets totally cleared
// do a hard refresh so everything gets totally cleared.
// Give them a moment to see the state transition. Dexie
// also apparently needs some time
setTimeout(() => {
window.location = '/login'
}, 300)
}, 1000)
}
</script>

View File

@ -2,5 +2,5 @@
import {onMount} from 'svelte'
import {navigate} from 'svelte-routing'
onMount(() => navigate('/notes/global'))
onMount(() => navigate('/notes/network'))
</script>

View File

@ -22,7 +22,7 @@
{/if}
<div>
<Tabs tabs={['global', 'network']} {activeTab} {setActiveTab} />
<Tabs tabs={['network', 'global']} {activeTab} {setActiveTab} />
{#if activeTab === 'network'}
<Network />
{:else}