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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user