Skip to content

Commit

Permalink
Fixed: No longer the empty-and-stilled log pane.
Browse files Browse the repository at this point in the history
  • Loading branch information
vrtmrz committed Dec 13, 2024
1 parent 2338601 commit 672940a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/modules/features/Log/LogPane.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onDestroy, onMount } from "svelte";
import { logMessages } from "../../../lib/src/mock_and_interop/stores";
import type { ReactiveInstance } from "../../../lib/src/dataobject/reactive";
import { reactive, type ReactiveInstance } from "../../../lib/src/dataobject/reactive";
import { Logger } from "../../../lib/src/common/logger";
let unsubscribe: () => void;
Expand All @@ -19,9 +19,10 @@
}
}
onMount(async () => {
logMessages.onChanged(updateLog);
const _logMessages = reactive(() => logMessages.value);
_logMessages.onChanged(updateLog);
Logger("Log window opened");
unsubscribe = () => logMessages.offChanged(updateLog);
unsubscribe = () => _logMessages.offChanged(updateLog);
});
onDestroy(() => {
if (unsubscribe) unsubscribe();
Expand Down

0 comments on commit 672940a

Please sign in to comment.