diff --git a/src/components/Log.svelte b/src/components/Log.svelte index 448c86e..2ae3a06 100644 --- a/src/components/Log.svelte +++ b/src/components/Log.svelte @@ -6,7 +6,7 @@ import type { Writable } from "svelte/store"; import { slide } from "svelte/transition"; - import type { AddMessageEvent, ResetMessagesEvent, Message } from "../shark/Message"; + import type { AddMessageEvent, ResetLogEvent, Message } from "../shark/Message"; import { MessageType } from "../shark/Message"; export let messages: Writable; @@ -14,15 +14,14 @@ const dispatch = createEventDispatcher<{ addMessage: AddMessageEvent; - resetLog: ResetMessagesEvent; + resetLog: ResetLogEvent; }>(); - // Shorthand function addMessage(message: string, messageType?: MessageType) { dispatch("addMessage", { message, messageType }); } - function resetMessages(notify = true) { - dispatch("resetLog", { notify }); + function resetLog() { + dispatch("resetLog"); } $: displayMessages = $messages.slice(-logLength).reverse(); @@ -44,8 +43,7 @@ addMessage("error" + $messages.length, MessageType.error); }}>Add Error - - +
    {#each displayMessages as message, i (message)} {#if i < logLength} diff --git a/src/components/Wrapper.svelte b/src/components/Wrapper.svelte index fff5f33..50b534e 100644 --- a/src/components/Wrapper.svelte +++ b/src/components/Wrapper.svelte @@ -1,5 +1,5 @@