From 35cbd7df342f45dfbdc383303b721807565edda0 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Mon, 20 Jan 2025 11:43:02 +0100 Subject: [PATCH] re-highlight on content load --- ui/mod/src/mod.inquiry.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/mod/src/mod.inquiry.ts b/ui/mod/src/mod.inquiry.ts index 548b8162d0c8c..893c9c9674b40 100644 --- a/ui/mod/src/mod.inquiry.ts +++ b/ui/mod/src/mod.inquiry.ts @@ -4,6 +4,7 @@ import { expandMentions } from 'common/richText'; import { storage } from 'common/storage'; import { alert } from 'common/dialog'; import { highlightSearchTerm } from 'common/highlight'; +import { pubsub } from 'common/pubsub'; site.load.then(() => { const noteStore = storage.make('inquiry-note'); @@ -116,5 +117,7 @@ site.load.then(() => { addToNote(`Alt: @${username}`); }); - setTimeout(() => highlightSearchTerm(username, '#main-wrap .user-link'), 500); + const highlightUsername = () => highlightSearchTerm(username, '#main-wrap .user-link'); + setTimeout(highlightUsername, 300); + pubsub.on('content-loaded', highlightUsername); });