Skip to content

Fix crash on state reset when preferences are queried#418

Merged
marcprux merged 1 commit into
mainfrom
rememberSaveablePreference
May 12, 2026
Merged

Fix crash on state reset when preferences are queried#418
marcprux merged 1 commit into
mainfrom
rememberSaveablePreference

Conversation

@marcprux
Copy link
Copy Markdown
Member

@marcprux marcprux commented May 8, 2026

This consolidates the logic for remembering preferences, and also handled potential null values which can come from the state being reset.

Fixes #417. Fixes #300.

@marcprux
Copy link
Copy Markdown
Member Author

marcprux commented May 9, 2026

As mentioned at #417 (comment), we don't see this in Showcase due to skiptools/skipapp-showcase@5bb3049#diff-e7075a061fc36788a2762feb445a61db436a6f07c529859334189e53914a04f7R53 which adds to Main.kt:

SideEffect { saveableStateHolder.removeState(true) }

I wonder if we should be adding that to every project's Main.kt, @aabewhite?

@marcprux marcprux requested a review from aabewhite May 9, 2026 14:23
@marcprux marcprux merged commit a3d8263 into main May 12, 2026
2 checks passed
@marcprux marcprux deleted the rememberSaveablePreference branch May 12, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant