Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove useless id field on LogItem #126

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/components/core/popups/popups/SerialMonitor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function insertDate() {
{/if}
{#if mode === Mode.TEXT}
<div class="content" bind:this={element}>
{#each $log as item (item.id)}
{#each $log as item}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is used as a performance optimization by svelte to not require the re-rendering of the entire dom when old items are deleted or items are moved

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now

<div class="item">
<div class="date">{formatDate(item.date)}</div>
<div class="text">{item.content}</div>
Expand Down
2 changes: 0 additions & 2 deletions src/lib/state/workspace.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export enum Prompt {
export class ConnectionFailedError {}

interface LogItem {
id: string;
date: Date;
content: string;
}
Expand Down Expand Up @@ -96,7 +95,6 @@ function createLogState() {
[
...log,
...items.map((content) => ({
id: crypto.randomUUID(),
date: new Date(),
content,
})),
Expand Down