💄 Fixes and improvements

This commit is contained in:
2024-08-07 01:47:53 +08:00
parent 7c0c1ec94f
commit eb02a47e9a
5 changed files with 27 additions and 21 deletions

View File

@ -8,6 +8,9 @@ class StickerProvider extends GetxController {
final RxList<Sticker> availableStickers = RxList.empty(growable: true);
Future<void> refreshAvailableStickers() async {
availableStickers.clear();
aliasImageMapping.clear();
final client = ServiceFinder.configureClient('files');
final resp = await client.get(
'/stickers/manifest?take=100',
@ -20,7 +23,7 @@ class StickerProvider extends GetxController {
for (final pack in out) {
for (final sticker in (pack.stickers ?? List<Sticker>.empty())) {
sticker.pack = pack;
aliasImageMapping['${pack.prefix}${sticker.alias}'.camelCase!] =
aliasImageMapping[sticker.textPlaceholder.toUpperCase()] =
sticker.imageUrl;
availableStickers.add(sticker);
}