Merge pull request #1386 from dannyl1u/feat/profile-image-initials

feat: default profile image with user initials
This commit is contained in:
Timothy Jaeryang Baek
2024-04-06 23:59:20 -07:00
committed by GitHub
8 changed files with 248 additions and 27 deletions

View File

@@ -6,6 +6,7 @@
import { WEBUI_NAME, config, user } from '$lib/stores';
import { onMount, getContext } from 'svelte';
import { toast } from 'svelte-sonner';
import { generateInitialsImage, canvasPixelTest } from '$lib/utils';
const i18n = getContext('i18n');
@@ -36,10 +37,12 @@
};
const signUpHandler = async () => {
const sessionUser = await userSignUp(name, email, password).catch((error) => {
toast.error(error);
return null;
});
const sessionUser = await userSignUp(name, email, password, generateInitialsImage(name)).catch(
(error) => {
toast.error(error);
return null;
}
);
await setSessionUser(sessionUser);
};