mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-03 23:43:28 +00:00
Move code intended to handle bad .ani files to the right place
This commit is contained in:
parent
ba7c12d6d7
commit
8c4d8894ec
2 changed files with 9 additions and 8 deletions
|
|
@ -93,10 +93,16 @@ const getCssRules = createSelector(
|
|||
case "cur":
|
||||
return `${selector} {cursor: url(${cursor.url}), auto}`;
|
||||
case "ani": {
|
||||
return convertAniBinaryToCSS(selector, cursor.aniData);
|
||||
try {
|
||||
return convertAniBinaryToCSS(selector, cursor.aniData);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.filter(Boolean);
|
||||
cssRules.push(...cursorRules);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -145,12 +145,7 @@ export async function getCursorFromFilename(
|
|||
}
|
||||
const contents = file.contents as Uint8Array;
|
||||
if (arrayStartsWith(contents, RIFF_MAGIC)) {
|
||||
try {
|
||||
return { type: "ani", aniData: contents };
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return null;
|
||||
}
|
||||
return { type: "ani", aniData: contents };
|
||||
}
|
||||
|
||||
return { type: "cur", url: FileUtils.curUrlFromByteArray(contents) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue