🐛 Bug fixes and optimize image display

This commit is contained in:
2024-11-13 00:13:27 +08:00
parent 9851093a1e
commit 468d1377af
5 changed files with 43 additions and 83 deletions

View File

@ -44,12 +44,18 @@ class SnAttachmentProvider {
'take': pendingFetch.length,
'id': pendingFetch.join(','),
});
final out = resp.data['data'].map((e) => SnAttachment.fromJson(e)).toList();
final out = resp.data['data']
.where((e) => e['id'] != 0)
.map((e) => SnAttachment.fromJson(e))
.toList();
for (var i = 0; i < out.length; i++) {
_cache[pendingFetch[i]] = out[i];
}
return rids.map((rid) => _cache[rid]!).toList();
return rids
.where((rid) => _cache.containsKey(rid))
.map((rid) => _cache[rid]!)
.toList();
}
static Map<String, String> mimetypeOverrides = {