diff --git a/src/app/(frontend)/account/actions.ts b/src/app/(frontend)/account/actions.ts index cbde0d1..0849011 100644 --- a/src/app/(frontend)/account/actions.ts +++ b/src/app/(frontend)/account/actions.ts @@ -207,6 +207,7 @@ export async function updatePreferences(input: { leadOrActual: "lead" | "actual"; discordEnabled: boolean; discordMutedTypes: string[]; + xpDisplayMini: boolean; }): Promise { try { const { payload, user } = await authenticate(); @@ -219,7 +220,7 @@ export async function updatePreferences(input: { (MUTEABLE_NOTIFICATION_VALUES as readonly string[]).includes(t), ); - await payload.update({ + await payload.update({ collection: "users", id: userId, data: { @@ -229,6 +230,7 @@ export async function updatePreferences(input: { showCallsign: input.showCallsign, showVersionOverlay: input.showVersionOverlay, leadOrActual: input.leadOrActual, + xpDisplayMini: input.xpDisplayMini, }, discord: { enabled: input.discordEnabled, diff --git a/src/collections/users/Users.ts b/src/collections/users/Users.ts index ace8ec8..2080b50 100644 --- a/src/collections/users/Users.ts +++ b/src/collections/users/Users.ts @@ -268,35 +268,41 @@ export const Users: CollectionConfig = { }, ], }, - { - name: "display", - label: "Display", - type: "group", - fields: [ - { - name: "showCallsign", - label: "Show callsign (username) instead of display name in the sidebar", - type: "checkbox", - defaultValue: false, - }, - { - name: "leadOrActual", - label: 'Use "Lead" or "Actual" when reviewing the unit roster', - type: "select", - options: [ - { label: "Lead", value: "lead" }, - { label: "Actual", value: "actual" }, - ], - defaultValue: "lead", - }, - { - name: "showVersionOverlay", - label: "Show version overlay at top of page", - type: "checkbox", - defaultValue: true, - }, - ], - }, + { + name: "display", + label: "Display", + type: "group", + fields: [ + { + name: "showCallsign", + label: "Show callsign (username) instead of display name in the sidebar", + type: "checkbox", + defaultValue: false, + }, + { + name: "leadOrActual", + label: 'Use "Lead" or "Actual" when reviewing the unit roster', + type: "select", + options: [ + { label: "Lead", value: "lead" }, + { label: "Actual", value: "actual" }, + ], + defaultValue: "lead", + }, + { + name: "showVersionOverlay", + label: "Show version overlay at top of page", + type: "checkbox", + defaultValue: true, + }, + { + name: "xpDisplayMini", + label: "Use mini mode for XP display", + type: "checkbox", + defaultValue: false, + }, + ], + }, { name: "discord", label: "Discord", diff --git a/src/payload-types.ts b/src/payload-types.ts index 36a856c..6591f7a 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -1313,6 +1313,7 @@ export interface User { showCallsign?: boolean | null; leadOrActual?: ('lead' | 'actual') | null; showVersionOverlay?: boolean | null; + xpDisplayMini?: boolean | null; }; discord?: { enabled?: boolean | null;