Remove missing href warnings

This commit is contained in:
Niek van der Maas 2023-03-03 15:06:24 +01:00
parent c98d83c2ef
commit 2608ad32e6
2 changed files with 11 additions and 7 deletions

View File

@ -62,10 +62,10 @@
{#if apiKey}
<article class="message is-info">
<div class="message-body">
<!-- svelte-ignore a11y-missing-attribute a11y-click-events-have-key-events -->
Select an existing chat on the sidebar, or
<a
on:click={() => {
href={"#"}
on:click|preventDefault={() => {
activeChatId = addChat();
}}>create a new chat</a
>

View File

@ -7,7 +7,6 @@
export let apiKey: string;
</script>
<!-- svelte-ignore a11y-missing-attribute a11y-click-events-have-key-events -->
<aside class="menu">
<p class="menu-label">Chats</p>
<ul class="menu-list">
@ -19,12 +18,14 @@
{#each sortedChats as chat}
<li>
<a
href={"#"}
class="panel-block {!apiKey
? 'is-disabled'
: ''} {activeChatId === chat.id
? 'has-background-light'
: ''}"
on:click={() => (activeChatId = chat.id)}>Chat {chat.id}</a
on:click|preventDefault={() => (activeChatId = chat.id)}
>Chat {chat.id}</a
>
</li>
{/each}
@ -36,26 +37,29 @@
<ul class="menu-list">
<li>
<a
href={"#"}
class="panel-block {!apiKey ? 'is-disabled' : ''} {activeChatId
? ''
: 'has-background-light'}"
on:click={() => {
on:click|preventDefault={() => {
activeChatId = null;
}}><span class="greyscale mr-2">🔑</span> API key</a
>
</li>
<li>
<a
href={"#"}
class="panel-block {!apiKey ? 'is-disabled' : ''}"
on:click={() => {
on:click|preventDefault={() => {
activeChatId = addChat();
}}><span class="greyscale mr-2"></span> New chat</a
>
</li>
<li>
<a
href={"#"}
class="panel-block {!apiKey ? 'is-disabled' : ''}"
on:click={() => {
on:click|preventDefault={() => {
clearChats();
activeChatId = null;
}}><span class="greyscale mr-2">🗑️</span> Clear chats</a