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 handleSaveImage = useCallback(() => {
|
||||
if (cardRef.current === null) {
|
||||
if (cardRef.current === null || !avatarSelected) {
|
||||
toast.error("Avatar showcase not found!");
|
||||
return;
|
||||
}
|
||||
@@ -39,14 +39,14 @@ export default function ShowCaseInfo() {
|
||||
html2canvas(cardRef.current, {scale: 2, backgroundColor: '#000000'})
|
||||
.then(function (canvas: HTMLCanvasElement) {
|
||||
const link = document.createElement('a');
|
||||
link.download = 'showcase.png';
|
||||
link.download = `${getNameChar(locale, avatarSelected)}_showcase.png`;
|
||||
link.href = canvas.toDataURL('image/png');
|
||||
link.click();
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Error generating showcase card!");
|
||||
});
|
||||
}, [cardRef])
|
||||
}, [cardRef, avatarSelected, locale])
|
||||
|
||||
useEffect(() => {
|
||||
if (!avatarSelected?.id) return;
|
||||
|
||||
Reference in New Issue
Block a user