feat: back port discriminators and display names

This commit is contained in:
Paul Makles
2023-06-11 12:44:05 +01:00
parent 86218a7272
commit 5b600bec20
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;