mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-06 04:58:23 +00:00
Update apps UX adjustments
This commit is contained in:
@@ -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'];
|
||||
|
||||
@@ -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") {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user