use custom emoji for payday
This commit is contained in:
@@ -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] });
|
||||
}
|
||||
|
||||
@@ -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 || ''
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,4 +8,5 @@ export interface SessionUser {
|
||||
pattern?: string;
|
||||
themeSize?: string;
|
||||
themeOpacity?: string;
|
||||
partyEmoji?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user