forked from Shinonome/dots-hyprland
added not_found
This commit is contained in:
@@ -127,6 +127,7 @@ const WaifuImage = (taglist) => {
|
|||||||
'download': ImageState('downloading', 'Downloading image'),
|
'download': ImageState('downloading', 'Downloading image'),
|
||||||
'done': ImageState('done', 'Finished!'),
|
'done': ImageState('done', 'Finished!'),
|
||||||
'error': ImageState('error', 'Error'),
|
'error': ImageState('error', 'Error'),
|
||||||
|
'notfound': ImageState('error', 'Not found!'),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const downloadIndicator = MarginRevealer({
|
const downloadIndicator = MarginRevealer({
|
||||||
@@ -204,6 +205,10 @@ const WaifuImage = (taglist) => {
|
|||||||
thisBlock.attribute.imageData = imageData;
|
thisBlock.attribute.imageData = imageData;
|
||||||
const { status, signature, url, extension, source, dominant_color, is_nsfw, width, height, tags } = thisBlock.attribute.imageData;
|
const { status, signature, url, extension, source, dominant_color, is_nsfw, width, height, tags } = thisBlock.attribute.imageData;
|
||||||
thisBlock.attribute.isNsfw = is_nsfw;
|
thisBlock.attribute.isNsfw = is_nsfw;
|
||||||
|
if (status == 404) {
|
||||||
|
downloadState.shown = 'notfound';
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (status != 200) {
|
if (status != 200) {
|
||||||
downloadState.shown = 'error';
|
downloadState.shown = 'error';
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user