diff --git a/src/libs/emojis/emojis.ts b/src/libs/emojis/emojis.ts deleted file mode 100644 index 53ccf6a2..00000000 --- a/src/libs/emojis/emojis.ts +++ /dev/null @@ -1,15 +0,0 @@ -export namespace Emojis { - - export const all = [ - "☁️", "☀️", "🌪️", "🔥" - ] as const - - export function mod(index: number) { - return index % all.length - } - - export function get(index: number) { - return all[mod(index)] - } - -} \ No newline at end of file diff --git a/src/mods/background/service_worker/entities/users/data.ts b/src/mods/background/service_worker/entities/users/data.ts index 99b476ce..4e362fda 100644 --- a/src/mods/background/service_worker/entities/users/data.ts +++ b/src/mods/background/service_worker/entities/users/data.ts @@ -36,9 +36,7 @@ export namespace UserRef { export interface UserInit { readonly uuid: string, readonly name: string, - readonly color: number - readonly emoji: string readonly password: string } @@ -46,9 +44,7 @@ export interface UserInit { export interface UserData { readonly uuid: string, readonly name: string, - readonly color: number - readonly emoji: string readonly keyParamsBase64: HmacPbkdf2ParamsBase64 readonly valueParamsBase64: AesGcmPbkdf2ParamsBase64 @@ -117,7 +113,7 @@ export namespace BgUser { } export async function createOrThrow(init: UserInit): Promise { - const { uuid, name, color, emoji, password } = init + const { uuid, name, color, password } = init const pbkdf2 = await crypto.subtle.importKey("raw", Bytes.fromUtf8(password), { name: "PBKDF2" }, false, ["deriveBits"]) @@ -158,7 +154,7 @@ export namespace BgUser { const passwordHashBytes = new Uint8Array(await crypto.subtle.deriveBits(passwordParamsBytes, pbkdf2, 256)) const passwordHashBase64 = Base64.get().encodePaddedOrThrow(passwordHashBytes) - return { uuid, name, color, emoji, keyParamsBase64, valueParamsBase64, passwordParamsBase64, passwordHashBase64 } + return { uuid, name, color, keyParamsBase64, valueParamsBase64, passwordParamsBase64, passwordHashBase64 } } } \ No newline at end of file diff --git a/src/mods/foreground/entities/users/all/create.tsx b/src/mods/foreground/entities/users/all/create.tsx index 55edd45d..a9a61fa9 100644 --- a/src/mods/foreground/entities/users/all/create.tsx +++ b/src/mods/foreground/entities/users/all/create.tsx @@ -1,5 +1,4 @@ import { Color } from "@/libs/colors/colors"; -import { Emojis } from "@/libs/emojis/emojis"; import { Errors } from "@/libs/errors/errors"; import { Outline } from "@/libs/icons/icons"; import { useModhash } from "@/libs/modhash/modhash"; @@ -29,7 +28,6 @@ export function UserCreateDialog(props: { next?: string }) { const modhash = useModhash(uuid) const color = Color.get(modhash) - const emoji = Emojis.get(modhash) const [rawNameInput = "", setRawNameInput] = useState() @@ -60,7 +58,7 @@ export function UserCreateDialog(props: { next?: string }) { }, []) const createOrAlert = useAsyncUniqueCallback(() => Errors.runAndLogAndAlert(async () => { - const user: UserInit = { uuid, name: finalNameInput, color: Color.all.indexOf(color), emoji, password: defPasswordInput } + const user: UserInit = { uuid, name: finalNameInput, color: Color.all.indexOf(color), password: defPasswordInput } await background.requestOrThrow({ method: "brume_createUser", @@ -80,7 +78,7 @@ export function UserCreateDialog(props: { next?: string }) { location.assign(next) return - }), [uuid, finalNameInput, color, emoji, defPasswordInput, background, close, next]) + }), [uuid, finalNameInput, color, defPasswordInput, background, close, next]) const onKeyDown = useCallback((e: KeyboardEvent) => { if (e.key !== "Enter")