changed observer callback

update names based on the element from the mutation event rather than checking the chatbox for unchecked messages each mutation
This commit is contained in:
zomo
2026-04-19 19:01:01 -05:00
parent 3b8c402873
commit 6218d6bad1
9 changed files with 272 additions and 165 deletions
+12 -2
View File
@@ -1,4 +1,4 @@
import { NameConfigInstance, NameConfig, nameList, colorList } from './options'
import { NameConfigInstance, nameList, colorList } from './options'
type StoredUsers = {
[username: string]: NameConfigInstance
@@ -72,7 +72,17 @@ function loadStoredUserData(): StoredData {
}
// TODO will be useful for better options
export function clearStoredUsers() {}
export function clearStoredUsers() {
localStorage.removeItem('obf-data')
storedUsers = {}
nameListUsed = {}
nameListCount = 0
}
;(unsafeWindow as any).obfClear = () => {
clearStoredUsers()
location.reload()
}
export function getRandomName(): NameConfigInstance {
const startingIndex = Math.round(Math.random() * (nameList.length - 1))