Skip to content

Commit

Permalink
limit to 50 apps, 50 faces
Browse files Browse the repository at this point in the history
  • Loading branch information
crc-32 committed Aug 9, 2024
1 parent 39af279 commit 5401866
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ui/home/tabs/locker_tab.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:math';

import 'package:cobble/domain/apps/app_compatibility.dart';
import 'package:cobble/domain/apps/app_manager.dart';
import 'package:cobble/domain/connection/connection_state_provider.dart';
Expand Down Expand Up @@ -101,6 +103,7 @@ class LockerTab extends HookConsumerWidget implements CobbleScreen {
),
delegate: SliverChildListDelegate(
compatibleFaces
.take(50)
.map<Widget>(
(face) => FacesCard(
listUrl: snap.data![face.appstoreId]?.getPlatformListImage(currentWatch?.runningFirmware.hardwarePlatform.getWatchType().name ?? ""),
Expand Down Expand Up @@ -137,6 +140,7 @@ class LockerTab extends HookConsumerWidget implements CobbleScreen {
),
delegate: SliverChildListDelegate(
incompatibleFaces
.take(50)
.map<Widget>(
(face) => FacesCard(
listUrl: snap.data![face.appstoreId]?.getPlatformListImage(currentWatch?.runningFirmware.hardwarePlatform.getWatchType().name ?? ""),
Expand Down Expand Up @@ -164,7 +168,7 @@ class LockerTab extends HookConsumerWidget implements CobbleScreen {
key: ValueKey(compatibleApps[index].uuid),
);
},
itemCount: compatibleApps.length,
itemCount: min(50, compatibleApps.length),
onReorder: (int fromIndex, int toIndex) {
if (toIndex > fromIndex) {
toIndex -= 1;
Expand Down Expand Up @@ -197,6 +201,7 @@ class LockerTab extends HookConsumerWidget implements CobbleScreen {
SliverList(
delegate: SliverChildListDelegate(
incompatibleApps
.take(50)
.map<Widget>(
(app) => AppsItem(
app: app,
Expand Down

0 comments on commit 5401866

Please sign in to comment.