mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
let native app fetch imgbb full images from non-direct links
This commit is contained in:
@@ -81,6 +81,12 @@ export const getLinkMediaInfo = memoize(
|
|||||||
return { url: link, type: 'image' };
|
return { url: link, type: 'image' };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Non-direct imgbb links can return lower res thumbnails on web. On native, the full image can be fetched later.
|
||||||
|
if (url.host === 'ibb.co' && !Capacitor.isNativePlatform()) {
|
||||||
|
const imageId = url.pathname.split('/')[1];
|
||||||
|
return { url: link, type: 'webpage', thumbnail: `https://i.ibb.co/${imageId}/thumbnail.jpg` };
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mime = extName(new URL(link).pathname.toLowerCase().replace('/', ''))[0]?.mime;
|
mime = extName(new URL(link).pathname.toLowerCase().replace('/', ''))[0]?.mime;
|
||||||
if (mime) {
|
if (mime) {
|
||||||
|
|||||||
Reference in New Issue
Block a user