forked from open-webui/open-webui
Fix: Restore Gravatar functionality, add button initials, toast duration
- Restore Gravatar functionality - Add new button for "Use Initials" - Set both buttons to use text-left class - Update toast property autoClose to duration (wrong library, my bad!) - Update toast messages to clarify that this isn't "Gravatar" but "avatar" - Add i18n text to en-US/translation.json
This commit is contained in:
parent
bee0338763
commit
924ebf035b
3 changed files with 16 additions and 5 deletions
|
@ -6,6 +6,7 @@
|
||||||
import { updateUserProfile } from '$lib/apis/auths';
|
import { updateUserProfile } from '$lib/apis/auths';
|
||||||
|
|
||||||
import UpdatePassword from './Account/UpdatePassword.svelte';
|
import UpdatePassword from './Account/UpdatePassword.svelte';
|
||||||
|
import { getGravatarUrl } from '$lib/apis/utils';
|
||||||
import { generateInitialsImage, canvasPixelTest } from '$lib/utils';
|
import { generateInitialsImage, canvasPixelTest } from '$lib/utils';
|
||||||
import { copyToClipboard } from '$lib/utils';
|
import { copyToClipboard } from '$lib/utils';
|
||||||
|
|
||||||
|
@ -146,20 +147,28 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class=" text-xs text-gray-600"
|
class=" text-xs text-left text-gray-600"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
if (canvasPixelTest()) {
|
if (canvasPixelTest()) {
|
||||||
profileImageUrl = generateInitialsImage(name);
|
profileImageUrl = generateInitialsImage(name);
|
||||||
} else {
|
} else {
|
||||||
toast.info(
|
toast.info(
|
||||||
$i18n.t(
|
$i18n.t(
|
||||||
'Fingerprint spoofing detected: default profile picture set. Disable to access Initial gravatar!'
|
'Fingerprint spoofing detected: default profile picture set. Disable to access Initial avatar!'
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
autoClose: 1000 * 10
|
duration: 1000 * 10
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}}>{$i18n.t('Use Initials')}</button
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
class=" text-xs text-left text-gray-600"
|
||||||
|
on:click={async () => {
|
||||||
|
const url = await getGravatarUrl($user.email);
|
||||||
|
|
||||||
|
profileImageUrl = url;
|
||||||
}}>{$i18n.t('Use Gravatar')}</button
|
}}>{$i18n.t('Use Gravatar')}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -150,6 +150,7 @@
|
||||||
"Failed to read clipboard contents": "",
|
"Failed to read clipboard contents": "",
|
||||||
"File Mode": "",
|
"File Mode": "",
|
||||||
"File not found.": "",
|
"File not found.": "",
|
||||||
|
"Fingerprint spoofing detected: default profile picture set. Disable to access Initial avatar!": "",
|
||||||
"Focus chat input": "",
|
"Focus chat input": "",
|
||||||
"Format your variables using square brackets like this:": "",
|
"Format your variables using square brackets like this:": "",
|
||||||
"From (Base Model)": "",
|
"From (Base Model)": "",
|
||||||
|
@ -340,6 +341,7 @@
|
||||||
"URL Mode": "",
|
"URL Mode": "",
|
||||||
"Use '#' in the prompt input to load and select your documents.": "",
|
"Use '#' in the prompt input to load and select your documents.": "",
|
||||||
"Use Gravatar": "",
|
"Use Gravatar": "",
|
||||||
|
"Use Initials": "",
|
||||||
"user": "",
|
"user": "",
|
||||||
"User Permissions": "",
|
"User Permissions": "",
|
||||||
"Users": "",
|
"Users": "",
|
||||||
|
|
|
@ -46,11 +46,11 @@
|
||||||
if (!canvasPixelTest()) {
|
if (!canvasPixelTest()) {
|
||||||
toast.info(
|
toast.info(
|
||||||
$i18n.t(
|
$i18n.t(
|
||||||
'Fingerprint spoofing detected: default profile picture set. Disable to access Initial gravatar!'
|
'Fingerprint spoofing detected: default profile picture set. Disable to access Initial avatar!'
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
position: 'bottom-center',
|
position: 'bottom-center',
|
||||||
autoClose: 1000 * 10
|
duration: 1000 * 10
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue