mirror of
https://github.com/ankitects/anki.git
synced 2025-11-12 23:57:13 -05:00
Fix lint errors
This commit is contained in:
parent
958599ed09
commit
0c98a68528
3 changed files with 9 additions and 6 deletions
|
|
@ -76,7 +76,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
window.removeEventListener("resize", resizeEvent);
|
window.removeEventListener("resize", resizeEvent);
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
destroyToast(toast);
|
destroyToast(toast!);
|
||||||
});
|
});
|
||||||
|
|
||||||
const resizeEvent = () => {
|
const resizeEvent = () => {
|
||||||
|
|
|
||||||
|
|
@ -8,17 +8,17 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { mdiClose } from "$lib/components/icons";
|
import { mdiClose } from "$lib/components/icons";
|
||||||
import type { ToastProps } from "./types";
|
import type { ToastProps } from "./types";
|
||||||
|
|
||||||
let { showToast, type, message }: ToastProps = $props();
|
const props: ToastProps = $props();
|
||||||
|
|
||||||
const closeToast = () => {
|
const closeToast = () => {
|
||||||
showToast = false;
|
props.showToast = false;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if showToast}
|
{#if props.showToast}
|
||||||
<div class="toast-container desktop-only">
|
<div class="toast-container desktop-only">
|
||||||
<div class="toast {type === 'success' ? 'success' : 'error'}">
|
<div class="toast {props.type === 'success' ? 'success' : 'error'}">
|
||||||
{message}
|
{props.message}
|
||||||
<IconButton iconSize={96} on:click={closeToast} class="toast-icon">
|
<IconButton iconSize={96} on:click={closeToast} class="toast-icon">
|
||||||
<Icon icon={mdiClose} />
|
<Icon icon={mdiClose} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { mount, unmount } from "svelte";
|
import { mount, unmount } from "svelte";
|
||||||
import Toast from "./Toast.svelte";
|
import Toast from "./Toast.svelte";
|
||||||
import type { ToastProps } from "./types";
|
import type { ToastProps } from "./types";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue