fix: strip all stacked status emojis from page title

The regex previously only stripped one leading emoji, so if emojis
stacked up, each update would only remove one, letting the stack grow.
Changed to use + quantifier to strip all leading emoji+space sequences.
This commit is contained in:
Graham McIntire 2026-03-12 13:16:18 -05:00
parent 58181923f8
commit b69b088d0f
No known key found for this signature in database

View file

@ -1369,7 +1369,7 @@ const StatusTitle = {
mounted(this: any) {
this.handleEvent("update_status_emoji", ({ emoji }: { emoji: string }) => {
const currentTitle = document.title
const titleWithoutEmoji = currentTitle.replace(/^(?:🔴|🟡|🟢)\s/u, "")
const titleWithoutEmoji = currentTitle.replace(/^(?:(?:🔴|🟡|🟢)\s)+/u, "")
document.title = emoji ? `${emoji} ${titleWithoutEmoji}` : titleWithoutEmoji
})
}