v2.0.8 #156
2
apps/dispatch/next-env.d.ts
vendored
2
apps/dispatch/next-env.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
import "./.next/types/routes.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
@@ -39,9 +39,9 @@ export const DISCORD_ROLES = {
|
||||
|
||||
export const getPublicUser = (
|
||||
user: User,
|
||||
options = {
|
||||
ignorePrivacy: false,
|
||||
fullLastName: false,
|
||||
options?: {
|
||||
ignorePrivacy?: boolean;
|
||||
fullLastName?: boolean;
|
||||
},
|
||||
): PublicUser => {
|
||||
const lastName = user.lastname
|
||||
@@ -50,7 +50,7 @@ export const getPublicUser = (
|
||||
.map((part) => `${part[0] || ""}.`)
|
||||
.join(" ");
|
||||
|
||||
if (options.fullLastName) {
|
||||
if (options?.fullLastName) {
|
||||
return {
|
||||
firstname: user.firstname,
|
||||
lastname: user.settingsHideLastname && !options.ignorePrivacy ? "" : user.lastname,
|
||||
@@ -63,9 +63,9 @@ export const getPublicUser = (
|
||||
|
||||
return {
|
||||
firstname: user.firstname,
|
||||
lastname: user.settingsHideLastname && !options.ignorePrivacy ? "" : lastName.trim(), // Only take the first letter of each section of the last name
|
||||
lastname: user.settingsHideLastname && !options?.ignorePrivacy ? "" : lastName.trim(), // Only take the first letter of each section of the last name
|
||||
fullName:
|
||||
`${user.firstname} ${user.settingsHideLastname && !options.ignorePrivacy ? "" : lastName}`.trim(),
|
||||
`${user.firstname} ${user.settingsHideLastname && !options?.ignorePrivacy ? "" : lastName}`.trim(),
|
||||
publicId: user.publicId,
|
||||
badges: user.badges,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user