Skip to content

Commit

Permalink
squelch some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 20, 2024
1 parent 42a410b commit e148b87
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apps/svelte.dev/src/routes/(authed)/apps/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { getContext } from 'svelte';
import { Icon } from '@sveltejs/site-kit/components';
import { ago } from '$lib/time';
import { goto, invalidateAll } from '$app/navigation';
Expand Down Expand Up @@ -66,23 +65,24 @@
/>
<span>
{data.user.github_name || data.user.github_login}
(<a on:click|preventDefault={logout} href="/auth/logout">log out</a>)
(<a onclick={(e) => (e.preventDefault(), logout())} href="/auth/logout">log out</a>)
</span>
</div>
</header>

<div class="controls">
{#if selected.length > 0}
<button class="delete" on:click={() => destroy_selected()} disabled={destroying}>
<button class="delete" onclick={destroy_selected} disabled={destroying}>
<Icon name="delete" />
Delete {selected.length}
{selected.length === 1 ? 'app' : 'apps'}
</button>

<button on:click={() => (selected = [])}>Clear selection</button>
<button onclick={() => (selected = [])}>Clear selection</button>
{:else}
<form
on:submit|preventDefault={(e) => {
onsubmit={(e) => {
e.preventDefault()
const search = new FormData(e.target as HTMLFormElement).get('search');
goto(search ? `/apps?search=${encodeURIComponent(search.toString())}` : '/apps');
}}
Expand Down Expand Up @@ -134,7 +134,8 @@
{/if}
{:else}
<p>
Please <a on:click|preventDefault={login} href="/auth/login">log in</a> to see your saved apps.
Please <a onclick={(e) => (e.preventDefault(), login())} href="/auth/login">log in</a> to see your
saved apps.
</p>
{/if}
</div>
Expand Down

0 comments on commit e148b87

Please sign in to comment.