Update apps UX adjustments

This commit is contained in:
franzap
2024-10-23 00:52:29 -03:00
parent 00fc3e152c
commit 8b04173284
3 changed files with 9 additions and 4 deletions
+4 -1
View File
@@ -81,7 +81,10 @@ mixin LocalAppAdapter on Adapter<LocalApp> {
.saveLocal();
}
// Update number of apps
updateNumberOfApps();
}
void updateNumberOfApps() {
final rs = db.select(
'SELECT count(*) as c FROM localApps WHERE json_extract(data, \'\$.status\') is \'updatable\'');
ref.read(appsToUpdateProvider.notifier).state = rs.first['c'];
+2
View File
@@ -39,6 +39,8 @@ final appInitializer = FutureProvider<void>((ref) async {
// Preload zapstore's nostr curation set
await ref.read(appCurationSetProvider(kNostrCurationSet).notifier).fetch();
ref.localApps.localAppAdapter.updateNumberOfApps();
// Handle deep links
final appLinksSub = appLinks.uriLinkStream.listen((uri) async {
if (uri.scheme == "zapstore") {
+3 -3
View File
@@ -14,8 +14,7 @@ class UpdatesScreen extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final state = ref.watch(updatesProvider);
if (!state.hasValue) return Container();
final (updatedApps, updatableApps) = state.value!;
final (updatedApps, updatableApps) = state.value ?? ([], []);
return SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
@@ -30,7 +29,8 @@ class UpdatesScreen extends HookConsumerWidget {
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold)),
],
),
if (updatedApps.isEmpty && updatableApps.isEmpty) SpinningLogo(),
if (updatedApps.isEmpty && updatableApps.isEmpty)
SpinningLogo(size: 80),
if (updatableApps.isNotEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.start,