feat: back port discriminators and display names

This commit is contained in:
Paul Makles
2023-06-11 12:44:05 +01:00
parent 0e5adb54b5
commit c9573c7440
16 changed files with 123 additions and 26 deletions

View File

@@ -5,7 +5,7 @@ import { useTriggerEvents } from "preact-context-menu";
import { memo } from "preact/compat";
import { useEffect, useState } from "preact/hooks";
import { Category, Button } from "@revoltchat/ui";
import { Category } from "@revoltchat/ui";
import { internalEmit } from "../../../lib/eventEmitter";
import { isTouchscreenDevice } from "../../../lib/isTouchscreenDevice";

View File

@@ -68,7 +68,9 @@ export const Username = observer(
override,
...otherProps
}: UsernameProps) => {
let username = user?.username;
let username =
(user as unknown as { display_name: string })?.display_name ??
user?.username;
let color = masquerade?.colour;
let timed_out: Date | undefined;

View File

@@ -37,7 +37,13 @@ export default observer(() => {
{(
[
["username", client.user!.username + "#0000", At],
[
"username",
client.user!.username +
"#" +
client.user!.discriminator,
At,
],
["email", email, Envelope],
["password", "•••••••••", Key],
] as const