Skip to content

Commit

Permalink
Change category pill container
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Jan 21, 2024
1 parent ca2bb63 commit fee17ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion maze-utils
4 changes: 2 additions & 2 deletions src/dearrowPromotion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { waitFor } from "../maze-utils/src";
import { getYouTubeTitleNode } from "../maze-utils/src/elements";
import { getBilibiliTitleNode } from "../maze-utils/src/elements";
import { getHash } from "../maze-utils/src/hash";
import { getVideoID, isOnInvidious, isOnMobileYouTube } from "../maze-utils/src/video";
import Config from "./config";
Expand All @@ -22,7 +22,7 @@ export async function tryShowingDeArrowPromotion() {

if (!await isDeArrowInstalled()) {
try {
const element = await waitFor(() => getYouTubeTitleNode(), 5000, 500, (e) => isVisible(e)) as HTMLElement;
const element = await waitFor(() => getBilibiliTitleNode(), 5000, 500, (e) => isVisible(e)) as HTMLElement;
if (element && element.innerText && badTitle(element.innerText)) {
const hashPrefix = (await getHash(getVideoID(), 1)).slice(0, 4);
const deArrowData = await asyncRequestToServer("GET", "/api/branding/" + hashPrefix);
Expand Down
4 changes: 2 additions & 2 deletions src/render/CategoryPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { VoteResponse } from "../messageTypes";
import { Category, SegmentUUID, SponsorTime } from "../types";
import { Tooltip } from "./Tooltip";
import { waitFor } from "../../maze-utils/src";
import { getYouTubeTitleNode } from "../../maze-utils/src/elements";
import { getBilibiliTitleNode } from "../../maze-utils/src/elements";
import { addCleanupListener } from "../../maze-utils/src/cleanup";

const id = "categoryPill";
Expand Down Expand Up @@ -44,7 +44,7 @@ export class CategoryPill {

private async attachToPageInternal(): Promise<void> {
const referenceNode =
await waitFor(() => getYouTubeTitleNode());
await waitFor(() => getBilibiliTitleNode());

if (referenceNode && !referenceNode.contains(this.container)) {
if (!this.container) {
Expand Down

0 comments on commit fee17ff

Please sign in to comment.