Skip to content

Commit f4edf9d

Browse files
committed
Merge branch 'main' of github.com:LiveTL/HyperChat into main
2 parents aaa04c8 + e5a6ee6 commit f4edf9d

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/components/ChatSummary.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import Icon from 'smelte/src/components/Icon';
66
import { Theme } from '../ts/chat-constants';
77
import { createEventDispatcher } from 'svelte';
8+
import { showTimestamps } from '../ts/storage';
89
910
export let summary: Ytc.ParsedSummary;
1011
@@ -55,6 +56,11 @@
5556
<span class="align-middle">{run.text}</span>
5657
{/if}
5758
{/each}
59+
{#if summary.timestamp && $showTimestamps}
60+
<span class="text-xs ml-1 text-gray-400 dark:text-gray-600 align-middle">
61+
{summary.timestamp}
62+
</span>
63+
{/if}
5864
</div>
5965
<div class="flex-none self-end" style="transform: translateY(3px);">
6066
<Tooltip offsetY={0} small>

src/components/RedirectBanner.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { slide, fade } from 'svelte/transition';
33
import MessageRun from './MessageRuns.svelte';
44
import Tooltip from './common/Tooltip.svelte';
5+
import Button from 'smelte/src/components/Button';
56
import Icon from 'smelte/src/components/Icon';
67
import { Theme } from '../ts/chat-constants';
78
import { createEventDispatcher } from 'svelte';
8-
import { showProfileIcons } from '../ts/storage';
9-
import Button from 'smelte/src/components/Button';
9+
import { showProfileIcons, showTimestamps } from '../ts/storage';
1010
1111
export let redirect: Ytc.ParsedRedirect;
1212
@@ -53,6 +53,11 @@
5353
</Icon>
5454
</span>
5555
<span class="align-middle">Live Redirect Notice</span>
56+
{#if redirect.timestamp && $showTimestamps}
57+
<span class="text-xs ml-1 text-gray-400 dark:text-gray-600 align-middle">
58+
{redirect.timestamp}
59+
</span>
60+
{/if}
5661
</div>
5762
<div class="flex-none self-end" style="transform: translateY(3px);">
5863
<Tooltip offsetY={0} small>

src/ts/chat-parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const parseChatSummary = (renderer: Ytc.AddChatItem, actionId: string, showtime:
104104
message: splitRuns[2],
105105
},
106106
showtime: showtime,
107+
timestamp: formatTimestamp(Date.now() * 1000),
107108
};
108109
return item;
109110
}
@@ -133,6 +134,7 @@ const parseRedirectBanner = (renderer: Ytc.AddChatItem, actionId: string, showti
133134
}
134135
},
135136
showtime: showtime,
137+
timestamp: formatTimestamp(Date.now() * 1000),
136138
};
137139
return item;
138140
}

src/ts/typings/ytc.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ declare namespace Ytc {
489489
message: ParsedRun[];
490490
};
491491
showtime: number;
492+
timestamp?: string;
492493
}
493494

494495
interface ParsedRedirect {
@@ -503,6 +504,7 @@ declare namespace Ytc {
503504
}
504505
};
505506
showtime: number;
507+
timestamp?: string;
506508
}
507509

508510
interface ParsedPoll {

0 commit comments

Comments
 (0)