Skip to content

Commit

Permalink
fix(ceremony): dont subscribe to logs from layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Swepool committed Oct 30, 2024
1 parent c9bd81c commit 0b38c5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 7 additions & 3 deletions ceremony/src/lib/components/Terminal/Activity.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<script lang="ts">
import { getState } from "$lib/state/index.svelte.ts"
import Print from "$lib/components/Terminal/Print.svelte"
import {Activity} from "$lib/state/live.svelte.ts";
import {onMount} from "svelte";
const { activity } = getState()
let activity: Activity | null = $state(null)
onMount(() => {
activity = new Activity()
})
function formatTimestamp(timestamp: string): string {
const date = new Date(timestamp)
Expand All @@ -20,7 +24,7 @@ function formatTimestamp(timestamp: string): string {
}
</script>

{#if activity.data}
{#if activity && activity.data}
<div class="flex flex-col-reverse">
{#each activity.data as item, i (item)}
{@const type = item.message.type}
Expand Down
3 changes: 0 additions & 3 deletions ceremony/src/lib/state/index.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { getContext, setContext } from "svelte"
import { Contributor } from "./contributor.svelte.ts"
import { Terminal } from "./terminal.svelte.ts"
import { user, type UserSession } from "$lib/state/session.svelte.ts"
import { Activity } from "$lib/state/live.svelte.ts"
import { Contributions } from "$lib/state/contributions.svelte.ts"

export interface AppState {
contributor: Contributor
terminal: Terminal
activity: Activity
contributions: Contributions
user: UserSession
}
Expand All @@ -20,7 +18,6 @@ export function createState() {
const state: AppState = {
contributor: new Contributor(),
terminal: new Terminal(),
activity: new Activity(),
contributions: new Contributions(),
user: user
}
Expand Down

0 comments on commit 0b38c5c

Please sign in to comment.