I attempted to update the onSelectedVariationsUpdated method in ProductSelectorViewModel.ktto persist the updated list of selected items using the SavedStateHandle, aiming to maintain state across configuration changes This approach was modeled after the existing pattern used for _selectedItems, where the initial state is retrieved from SavedStateHandle and subsequently updated within the ViewModel.
Despite following the established pattern, including updating the _selectedItems state flow and attempting to save the updated list of selected items back to the SavedStateHandle using the key "key_selected_items", the solution did not work as expected. The intention was to ensure that any changes to the selected items, especially after handling variation selection results, would be preserved. However, the updated list of selected items does not seem to be correctly stored or retrieved from the SavedStateHandle.
I also explored utilization of handleDialogResult but had challenges with that where all entryId I attempted to use would cause crashes.
I attempted to update the
onSelectedVariationsUpdated
method inProductSelectorViewModel.kt
to persist the updated list of selected items using theSavedStateHandle
, aiming to maintain state across configuration changes This approach was modeled after the existing pattern used for_selectedItems
, where the initial state is retrieved fromSavedStateHandle
and subsequently updated within the ViewModel.Despite following the established pattern, including updating the
_selectedItems
state flow and attempting to save the updated list of selected items back to theSavedStateHandle
using the key "key_selected_items", the solution did not work as expected. The intention was to ensure that any changes to the selected items, especially after handling variation selection results, would be preserved. However, the updated list of selected items does not seem to be correctly stored or retrieved from theSavedStateHandle
.I also explored utilization of
handleDialogResult
but had challenges with that where allentryId
I attempted to use would cause crashes.