mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 11:01:45 +00:00
feat: reformula landing page e experiência mobile
This commit is contained in:
@@ -4,12 +4,9 @@ import { DEFAULT_PAYER_AVATAR } from "@/shared/lib/payers/constants";
|
||||
|
||||
const AVATAR_DIRECTORY = path.join(process.cwd(), "public", "avatars");
|
||||
const AVATAR_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".svg", ".webp"]);
|
||||
let avatarOptionsPromise: Promise<string[]> | null = null;
|
||||
|
||||
/**
|
||||
* Loads available avatar files from the public/avatars directory
|
||||
* @returns Array of unique avatar filenames sorted alphabetically
|
||||
*/
|
||||
export async function loadAvatarOptions() {
|
||||
async function readAvatarOptions() {
|
||||
try {
|
||||
const files = await readdir(AVATAR_DIRECTORY, { withFileTypes: true });
|
||||
|
||||
@@ -28,3 +25,12 @@ export async function loadAvatarOptions() {
|
||||
return [DEFAULT_PAYER_AVATAR];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads available avatar files from the public/avatars directory
|
||||
* @returns Array of unique avatar filenames sorted alphabetically
|
||||
*/
|
||||
export async function loadAvatarOptions() {
|
||||
avatarOptionsPromise ??= readAvatarOptions();
|
||||
return avatarOptionsPromise;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user