Skip to content

Commit

Permalink
add hc/ltl duplicate checking to 404 mounter
Browse files Browse the repository at this point in the history
  • Loading branch information
r2dev2 committed May 25, 2024
1 parent 14e28f3 commit 6124be6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Hyperchat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
$showProfileIcons, $showUsernames, $showTimestamps, $showUserBadges
);
const containerClass = 'h-screen w-screen text-black dark:text-white bg-white bg-ytbg-light dark:bg-ytbg-dark flex flex-col justify-between max-w-none';
const containerClass = 'hyperchat-root h-screen w-screen text-black dark:text-white bg-white bg-ytbg-light dark:bg-ytbg-dark flex flex-col justify-between max-w-none';
const isSuperchat = (action: Chat.MessageAction) => (action.message.superChat || action.message.superSticker);
const isMembership = (action: Chat.MessageAction) => (action.message.membership || action.message.membershipGiftPurchase);
Expand Down
12 changes: 11 additions & 1 deletion src/scripts/chat-mounter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Hyperchat from '../components/Hyperchat.svelte';
import tailwind from 'smelte/src/tailwind.css?inline';
import { isLiveTL } from '../ts/chat-constants';

const mount = (): void => {
console.log('[HyperChat] mounted hyperchat as content script');
Expand Down Expand Up @@ -30,4 +31,13 @@ const mount = (): void => {
}, 1);
};

mount();
if (isLiveTL) {
mount();
}
else {
setTimeout(() => {
if (document.querySelector('.hyperchat-root') === null) {
mount();
}
}, 500);
}

0 comments on commit 6124be6

Please sign in to comment.