Restores a previously saved session state by updating all UI inputs and
reactive values to match the saved configuration. Intended to be called
inside an observeEvent() triggered by a session file upload, and
again after model compilation completes for inputs that require a compiled
model to exist first.
Usage
restore_session_state(
state,
input,
session,
rv,
uploaded_data_override,
show_note,
selectize_choices = NULL
)Arguments
- state
A named list produced by
get_session_state, typically loaded viareadRDS(). Must contain aversionfield for compatibility checking.- input
The Shiny
inputobject from the current server session.- session
The Shiny
sessionobject passed to allupdateXxx()calls.- rv
A
reactiveValuesobject containing server-side state not bound to UI inputs. Fields are overwritten directly.- uploaded_data_override
A
reactiveValused to inject the restored dataset intouploaded_data()without requiring a file upload.- show_note
Logical. Whether to display a version compatibility notification on restore. Default
TRUE.- selectize_choices
Workaround for restoring nonmem_y_axis and color_data_by
Details
Restoration covers: dataset cleaning options, NCA settings, plot options,
dosing regimens for both models, simulation settings, PSA options, and
variability settings. Inputs are restored via the appropriate
updateXxx() function for each widget type.
A version compatibility notification is shown if show_note = TRUE
and a version field is present in state, but restoration
proceeds regardless of version match.
See also
get_session_state for the complementary save function.