fix: Import sticker packs

This commit is contained in:
Christian Kußowski 2025-11-14 15:18:13 +01:00
commit 1a38777cea
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -276,27 +276,17 @@ class EmotesSettingsController extends State<EmotesSettings> {
} }
Future<void> importEmojiZip() async { Future<void> importEmojiZip() async {
final result = await showFutureLoadingDialog<Archive?>(
context: context,
future: () async {
final result = await selectFiles( final result = await selectFiles(
context, context,
type: FileSelectorType.zip, type: FileSelectorType.zip,
); );
if (result.isEmpty) return null; if (result.isEmpty) return;
final buffer = InputMemoryStream(await result.first.readAsBytes()); final buffer = InputMemoryStream(await result.single.readAsBytes());
final archive = ZipDecoder().decodeStream(buffer); final archive = ZipDecoder().decodeStream(buffer);
return archive;
},
);
final archive = result.result;
if (archive == null) return;
await showDialog( await showDialog(
context: context, context: context,
// breaks [Matrix.of] calls otherwise // breaks [Matrix.of] calls otherwise