Skip to content

Commit cd50134

Browse files
authored
chore: filter apps from aotd widget (#1316)
1 parent 320744e commit cd50134

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

frontend/src/components/home/widgets/AppOfTheDayWidget.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ export function AppOfTheDayWidget() {
1717
return x - Math.floor(x);
1818
}
1919

20+
// filter out apps which already have a widget
21+
const excludedAppIds = ["alby-go", "zapplanner"];
22+
const apps = suggestedApps.filter((a) => !excludedAppIds.includes(a.id));
23+
2024
const daysSinceEpoch = Math.floor(Date.now() / (1000 * 60 * 60 * 24));
21-
const todayIndex = Math.floor(
22-
seededRandom(daysSinceEpoch) * suggestedApps.length
23-
);
24-
const app = suggestedApps[todayIndex];
25+
const todayIndex = Math.floor(seededRandom(daysSinceEpoch) * apps.length);
26+
const app = apps[todayIndex];
2527

2628
return (
2729
<Card>

0 commit comments

Comments
 (0)