mirror of
https://github.com/SableClient/Sable.git
synced 2026-12-05 00:02:22 -08:00
Allow favoriting all gifs (#1029)
<!-- Please read https://github.com/SableClient/Sable/blob/dev/CONTRIBUTING.md before submitting your pull request --> ### Description Allows favoriting all types of gifs Fixes #1015 #### Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings ### AI disclosure: - [ ] Partially AI assisted (clarify which code was AI assisted and briefly explain what it does). - [ ] Fully AI generated (explain what all the generated code does in moderate detail).
This commit is contained in:
2 files changed
+17
-1
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Allow favoriting all animated attachment types
|
||||
@@ -137,6 +137,17 @@ export const ImageContent = as<'div', ImageContentProps>(
|
||||
favoritedContent.gifs.find((v) => v.url == url) != undefined
|
||||
);
|
||||
|
||||
const isGif =
|
||||
info?.mimetype === 'image/gif' ||
|
||||
info?.mimetype === 'image/apng' ||
|
||||
info?.mimetype === 'image/webp' ||
|
||||
body.toLowerCase().endsWith('.gif') ||
|
||||
body.toLowerCase().endsWith('.apng') ||
|
||||
body.toLowerCase().endsWith('.webp') ||
|
||||
url.toLowerCase().endsWith('.gif') ||
|
||||
url.toLowerCase().endsWith('.apng') ||
|
||||
url.toLowerCase().endsWith('.webp');
|
||||
|
||||
const [srcState, loadSrc] = useAsyncCallback(
|
||||
useCallback(async () => {
|
||||
if (url.startsWith('http')) return url;
|
||||
@@ -409,7 +420,7 @@ export const ImageContent = as<'div', ImageContentProps>(
|
||||
>
|
||||
{menuIcon(blurred ? Eye : EyeSlash)}
|
||||
</MenuItem>
|
||||
{info?.mimetype == 'image/gif' && (
|
||||
{isGif && (
|
||||
<MenuItem
|
||||
size="300"
|
||||
radii="0"
|
||||
|
||||
Reference in new issue
Block a user