Skip to content

Commit

Permalink
fix: neo session launcher reset function behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ironAiken2 committed Jan 7, 2025
1 parent e2c145d commit 6163c60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion react/src/components/SessionLauncherPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const SessionLauncherPreview: React.FC<{
/>
</Col>
<Col>
{/* {form.getFieldValue('environments').image} */}
{/* {imageInfo.image} */}
<Flex direction="row" wrap="wrap">
{form.getFieldValue('environments')?.manual ? (
<Typography.Text
Expand Down
2 changes: 1 addition & 1 deletion react/src/helper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export const toGlobalId = (type: string, id: string): string => {
return btoa(`${type}:${id}`);
};

export function preserveDotStartCase(str: string) {
export function preserveDotStartCase(str: string = '') {
// Temporarily replace periods with a unique placeholder
const placeholder = '<<<DOT>>>';
const tempStr = str.replace(/\./g, placeholder);
Expand Down
7 changes: 5 additions & 2 deletions react/src/pages/SessionLauncherPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ const SessionLauncherPage = () => {
supportBatchTimeout,
],
);
console.log(INITIAL_FORM_VALUES);
const StepParam = withDefault(NumberParam, 0);
const FormValuesParam = withDefault(JsonParam, INITIAL_FORM_VALUES);
const AppOptionParam = withDefault(JsonParam, {});
Expand Down Expand Up @@ -365,6 +366,8 @@ const SessionLauncherPage = () => {
(item) => item.errors.length > 0,
);

console.log('#', form.getFieldValue('environments'));

const [finalStepLastValidateTime, setFinalStepLastValidateTime] =
useUpdatableState('first'); // Force re-render after validation in final step.

Expand Down Expand Up @@ -1380,8 +1383,8 @@ const SessionLauncherPage = () => {
<Popconfirm
title={t('button.Reset')}
description={t('session.launcher.ResetFormConfirm')}
onConfirm={() => {
webuiNavigate('/session/start');
onConfirm={async () => {
await Promise.all([setQuery({}, 'replace')]);
form.resetFields();
}}
icon={
Expand Down

0 comments on commit 6163c60

Please sign in to comment.