mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-06 04:58:23 +00:00
Fix curation sets
This commit is contained in:
@@ -24,10 +24,9 @@ mixin AppCurationSetAdapter on Adapter<AppCurationSet> {
|
||||
@override
|
||||
DeserializedData<AppCurationSet> deserialize(Object? data, {String? key}) {
|
||||
final list = data is Iterable ? data : [data as Map];
|
||||
for (final e in list) {
|
||||
final map = e as Map<String, dynamic>;
|
||||
final aValues = (map['tags'] as Iterable).where((t) => t[0] == 'a');
|
||||
map['apps'] = aValues.map((e) => e[1].split(':')[2]);
|
||||
for (final Map<String, dynamic> map in list) {
|
||||
final tagMap = tagsToMap(map['tags']);
|
||||
map['apps'] = tagMap['a'];
|
||||
}
|
||||
return super.deserialize(data);
|
||||
}
|
||||
|
||||
@@ -33,8 +33,10 @@ class AppDetailScreen extends HookConsumerWidget {
|
||||
|
||||
// TODO: Workaround for bug in watchAll (when remote=true)
|
||||
// TODO: Just fetch the signer, no need to refetch again??
|
||||
useFuture(useMemoized(() =>
|
||||
ref.apps.findOne(model.id!, remote: true, params: {'includes': true})));
|
||||
useFuture(useMemoized(() {
|
||||
return ref.apps
|
||||
.findOne(model.identifier!, remote: true, params: {'includes': true});
|
||||
}));
|
||||
|
||||
final app = state.model ?? model;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:flutter_layout_grid/flutter_layout_grid.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:purplebase/purplebase.dart';
|
||||
import 'package:zapstore/main.data.dart';
|
||||
import 'package:zapstore/models/app.dart';
|
||||
import 'package:zapstore/widgets/app_card.dart';
|
||||
@@ -21,7 +22,11 @@ class AppCategoriesNotifier
|
||||
.findAll(params: {'#d': appSets.map((s) => s.appIds).flattened});
|
||||
}
|
||||
|
||||
final curationSet = ref.appCurationSets.findOneLocalById(arg.name)!;
|
||||
final curationSet = ref.appCurationSets.findOneLocalById((
|
||||
30267,
|
||||
'78ce6faa72264387284e647ba6938995735ec8c7d5c5a65737e55130f026307d',
|
||||
arg.name
|
||||
).formatted)!;
|
||||
return ref.apps.appAdapter.findWhereIdInLocal(curationSet.appIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class LatestReleasesContainer extends HookConsumerWidget {
|
||||
class LatestReleasesAppNotifier extends AutoDisposeAsyncNotifier<List<App>> {
|
||||
@override
|
||||
Future<List<App>> build() async {
|
||||
final timer = Timer.periodic(Duration(minutes: 10), (_) => fetch());
|
||||
final timer = Timer.periodic(Duration(minutes: 1), (_) => fetch());
|
||||
ref.onDispose(timer.cancel);
|
||||
fetch();
|
||||
// .catchError((e) {
|
||||
|
||||
Reference in New Issue
Block a user