use custom emoji for payday

This commit is contained in:
JCEEE
2026-09-21 08:35:13 +01:00
parent 8e4eef06f5
commit a8c674f8b3
8 changed files with 58 additions and 1 deletions
+3
View File
@@ -479,6 +479,9 @@ async function ensureUserFields(): Promise<void> {
if (!has('passwordResetExpiry')) {
needed.push({ name: 'passwordResetExpiry', type: 'text', required: false });
}
if (!has('partyEmoji')) {
needed.push({ name: 'partyEmoji', type: 'text', required: false });
}
if (needed.length) {
await updateCollection(usersCol.id, { ...usersCol, fields: [...usersCol.fields, ...needed] });
}
+4
View File
@@ -76,6 +76,7 @@ export async function getProfile(pb: any, famId: string, userId: string) {
pattern: rec.pattern || '',
themeSize: rec.themeSize || '',
themeOpacity: rec.themeOpacity || '',
partyEmoji: rec.partyEmoji || '',
email: rec.email || ''
};
}
@@ -92,6 +93,8 @@ export async function updateProfile(
if (data.pattern !== undefined) patch.pattern = data.pattern;
if (data.themeSize !== undefined) patch.themeSize = data.themeSize;
if (data.themeOpacity !== undefined) patch.themeOpacity = data.themeOpacity;
if (data.partyEmoji !== undefined)
patch.partyEmoji = String(data.partyEmoji).trim().slice(0, 8) || '🐖';
if (data.email !== undefined) patch.email = data.email;
const rec = await pb.collection('users').update(userId, patch);
return {
@@ -101,6 +104,7 @@ export async function updateProfile(
pattern: rec.pattern || '',
themeSize: rec.themeSize || '',
themeOpacity: rec.themeOpacity || '',
partyEmoji: rec.partyEmoji || '',
email: rec.email || ''
};
}
+1
View File
@@ -8,4 +8,5 @@ export interface SessionUser {
pattern?: string;
themeSize?: string;
themeOpacity?: string;
partyEmoji?: string;
}