Merge branch 'main' into fix/increase-protobuf-limit

This commit is contained in:
Moustapha Kodjo Amadou 2025-06-24 11:59:40 +01:00 committed by GitHub
commit 181c3b5ccc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 9 deletions

View file

@ -118,7 +118,7 @@ class _MyAppState extends ConsumerState<MyApp> {
routerDelegate: router.routerDelegate,
routeInformationProvider: router.routeInformationProvider,
title: 'MangaYomi',
scrollBehavior: AllowDesktopScrollBehavior(),
scrollBehavior: AllowScrollBehavior(),
);
}
@ -233,10 +233,21 @@ class _MyAppState extends ConsumerState<MyApp> {
}
}
class AllowDesktopScrollBehavior extends MaterialScrollBehavior {
class AllowScrollBehavior extends MaterialScrollBehavior {
// This allows the scrollable widgets to be scrolled with touch, mouse, stylus,
// inverted stylus, trackpad, and unknown pointer devices.
// This is useful for accessibility purposes, such as when using VoiceAccess,
// which sends pointer events with unknown type when scrolling scrollables.
// This is also useful for desktop platforms, where touch, stylus, and trackpad
// interactions are common, and we want to ensure a consistent scrolling experience
// across all devices.
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
PointerDeviceKind.stylus,
PointerDeviceKind.invertedStylus,
PointerDeviceKind.trackpad,
PointerDeviceKind.unknown,
};
}

View file

@ -63,6 +63,8 @@ void doRestore(Ref ref, {required String path, required BuildContext context}) {
}
} catch (e, s) {
botToast('$e\n$s');
} finally {
inputStream.close();
}
}
@ -380,13 +382,10 @@ void restoreKotatsuBackup(Ref ref, Archive archive) {
@riverpod
void restoreTachiBkBackup(Ref ref, String path, BackupType bkType) {
final content = GZipDecoder().decodeBytes(
InputFileStream(path).toUint8List(),
);
final backup = BackupMihon.create();
backup.mergeFromCodedBufferReader(
CodedBufferReader(content, sizeLimit: 250 << 20),
);
final inputStream = InputFileStream(path);
final content = GZipDecoder().decodeBytes(inputStream.toUint8List());
inputStream.close();
final backup = BackupMihon.fromBuffer(content);
List<Category> cats = [];
isar.writeTxnSync(() {
isar.categorys.clearSync();