UPDATE: some qol
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 1m39s
All checks were successful
Gitea Auto Deploy / Deploy-Container (push) Successful in 1m39s
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 257 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB |
@@ -31,7 +31,7 @@ export default function ShowCaseInfo() {
|
|||||||
const { mapRelicInfo } = useRelicStore()
|
const { mapRelicInfo } = useRelicStore()
|
||||||
|
|
||||||
const handleSaveImage = useCallback(() => {
|
const handleSaveImage = useCallback(() => {
|
||||||
if (cardRef.current === null) {
|
if (cardRef.current === null || !avatarSelected) {
|
||||||
toast.error("Avatar showcase not found!");
|
toast.error("Avatar showcase not found!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -39,14 +39,14 @@ export default function ShowCaseInfo() {
|
|||||||
html2canvas(cardRef.current, {scale: 2, backgroundColor: '#000000'})
|
html2canvas(cardRef.current, {scale: 2, backgroundColor: '#000000'})
|
||||||
.then(function (canvas: HTMLCanvasElement) {
|
.then(function (canvas: HTMLCanvasElement) {
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.download = 'showcase.png';
|
link.download = `${getNameChar(locale, avatarSelected)}_showcase.png`;
|
||||||
link.href = canvas.toDataURL('image/png');
|
link.href = canvas.toDataURL('image/png');
|
||||||
link.click();
|
link.click();
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
toast.error("Error generating showcase card!");
|
toast.error("Error generating showcase card!");
|
||||||
});
|
});
|
||||||
}, [cardRef])
|
}, [cardRef, avatarSelected, locale])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!avatarSelected?.id) return;
|
if (!avatarSelected?.id) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user