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:
parent
58181923f8
commit
b69b088d0f
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue