Update to svelte 5
This commit is contained in:
@@ -3,8 +3,8 @@ import { onMount } from "svelte";
|
||||
import CopyButton from "layout/CopyButton.svelte";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
let app_name = ""
|
||||
let api_key = ""
|
||||
let app_name = $state("")
|
||||
let api_key = $state("")
|
||||
const create_key = async () => {
|
||||
loading_start()
|
||||
try {
|
||||
@@ -30,7 +30,7 @@ const create_key = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
let show_key = ""
|
||||
let show_key = $state("")
|
||||
const toggle_show_key = () => {
|
||||
if (show_key === "") {
|
||||
show_key = api_key
|
||||
@@ -90,7 +90,7 @@ onMount(() => {
|
||||
|
||||
{#if !api_key}
|
||||
<div class="center">
|
||||
<button class="button_highlight" on:click={create_key}>
|
||||
<button class="button_highlight" onclick={create_key}>
|
||||
<i class="icon">add</i>
|
||||
Generate key
|
||||
</button>
|
||||
@@ -100,7 +100,7 @@ onMount(() => {
|
||||
|
||||
<div class="copy_container">
|
||||
<CopyButton text={api_key}>Copy key to clipboard</CopyButton>
|
||||
<button on:click={toggle_show_key} class="copy_button" class:button_highlight={show_key !== ""}>
|
||||
<button onclick={toggle_show_key} class="copy_button" class:button_highlight={show_key !== ""}>
|
||||
<i class="icon">visibility</i>
|
||||
{#if show_key === ""}
|
||||
Show key
|
||||
|
||||
Reference in New Issue
Block a user