fix: cap widget task list at 30 items to prevent memory issues
Add safety limit of 30 rendered tasks in the widget to avoid Android memory constraints. Also add cross-reference comment for the implicit AsyncStorage coupling with useSettingsStore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2e13528c6b
commit
9a8bb13e97
2 changed files with 3 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ export async function syncWidgetData(): Promise<void> {
|
|||
const todayStart = startOfDay(now);
|
||||
|
||||
// Read widget period setting from AsyncStorage (0 = all, N = N weeks ahead)
|
||||
// Coupled with useSettingsStore.ts — key 'simpl-liste-settings', path state.widgetPeriodWeeks
|
||||
let widgetPeriodWeeks = 0;
|
||||
try {
|
||||
const settingsRaw = await AsyncStorage.getItem('simpl-liste-settings');
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ function ListWidgetContent({
|
|||
</FlexWidget>
|
||||
</FlexWidget>
|
||||
|
||||
{/* Task list */}
|
||||
{/* Task list — cap at 30 items to avoid Android widget memory limits */}
|
||||
{tasks.length > 0 ? (
|
||||
<ListWidget
|
||||
style={{
|
||||
|
|
@ -481,7 +481,7 @@ function ListWidgetContent({
|
|||
width: 'match_parent',
|
||||
}}
|
||||
>
|
||||
{tasks.map((task) => (
|
||||
{tasks.slice(0, 30).map((task) => (
|
||||
<FlexWidget
|
||||
key={task.id}
|
||||
style={{
|
||||
|
|
|
|||
Loading…
Reference in a new issue