fix(auth): align session lifecycle with Keycloak
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
queryFeaturesByIds,
|
||||
} from "@/utils/mapQueryService";
|
||||
import { useControllableObjectState } from "@components/olmap/core/useControllableState";
|
||||
import { useSessionRecoveryDraft } from "@/lib/sessionRecoveryDraft";
|
||||
|
||||
export interface ContaminantAnalysisParametersState {
|
||||
schemeName: string;
|
||||
@@ -62,7 +63,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
|
||||
const { open } = useNotification();
|
||||
|
||||
const network = NETWORK_NAME;
|
||||
const [parametersState, , setFormField] = useControllableObjectState(
|
||||
const [parametersState, setParametersState, setFormField] = useControllableObjectState(
|
||||
state,
|
||||
onStateChange,
|
||||
createContaminantAnalysisParametersState(),
|
||||
@@ -75,6 +76,12 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
|
||||
duration,
|
||||
pattern,
|
||||
} = parametersState;
|
||||
useSessionRecoveryDraft("contaminant-simulation", parametersState, (draft) =>
|
||||
setParametersState({
|
||||
...draft,
|
||||
startTime: draft.startTime ? dayjs(draft.startTime) : null,
|
||||
}),
|
||||
);
|
||||
const [isSelecting, setIsSelecting] = useState<boolean>(false);
|
||||
const [submitting, setSubmitting] = useState<boolean>(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user