Skip to content

Fix: Fix contact form retaining old text after sending#444

Merged
d4rken merged 1 commit intomainfrom
fix/viewmodel-scoping-nav3
Mar 10, 2026
Merged

Fix: Fix contact form retaining old text after sending#444
d4rken merged 1 commit intomainfrom
fix/viewmodel-scoping-nav3

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented Mar 10, 2026

What changed

Fixed an issue where the "Contact Developer" form would keep the previously entered text when reopening the screen after sending an email.

Technical Context

  • Root cause: NavDisplay in MainActivity was missing the ViewModelStoreNavEntryDecorator, so hiltViewModel() scoped all ViewModels to the Activity instead of their navigation entry. When an entry was popped from the back stack, its ViewModel survived and was reused on the next visit.
  • The lifecycle-viewmodel-navigation3:2.10.0 dependency was already in the project but never wired up — this connects it by adding entryDecorators to NavDisplay.
  • This fixes the same class of stale-state bug for all screens, not just the contact form.

@d4rken d4rken added the bug Something isn't working label Mar 10, 2026
@d4rken d4rken merged commit 12e3563 into main Mar 10, 2026
9 checks passed
@d4rken d4rken deleted the fix/viewmodel-scoping-nav3 branch March 10, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant