Skip to content

Commit

Permalink
environment discard changes on tab switching works fine
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtCoder19 committed Oct 8, 2024
1 parent f5bd8ea commit 4034a10
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions lib/client/hooks/use-unsaved-changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export const UnsavedChangesProvider = ({
}
return hasChanges;
},
[hasChanges],
),
[hasChanges]
)
);

useEffect(() => {
Expand Down Expand Up @@ -122,7 +122,7 @@ export const UnsavedChangesProvider = ({
performAction,
setPerformAction,
s,
],
]
)}
>
{children}
Expand Down Expand Up @@ -163,6 +163,5 @@ export const DISCARD_ACTIONS = {
};

export const useUnsavedChanges = () => {
// const
return useContext(UnsavedChanges);
};
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const Layout = () => {
setIgnorePaths(
navItems.map(
(ni) =>
`/${account}/env/${environment}/app/${appName}/settings/${ni.value}`,
),
`/${account}/env/${environment}/app/${appName}/settings/${ni.value}`
)
);
}, []);

Expand Down Expand Up @@ -144,11 +144,11 @@ const Layout = () => {
if (app.ciBuildId) {
if (
readOnlyApp.spec.containers?.[0].image.includes(
constants.defaultAppRepoNameOnly,
constants.defaultAppRepoNameOnly
)
) {
return `${constants.defaultAppRepoName(
accountName,
accountName
)}:${tagName}`;
}
return `${registryHost}/${accountName}/${
Expand All @@ -159,7 +159,7 @@ const Layout = () => {
}`;
}
return `${constants.defaultAppRepoName(
accountName,
accountName
)}:${tagName}`;
})(),
name: 'container-0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export const EnvironmentVariables = () => {
initialValues: getReadOnlyContainer().env || null,
validationSchema: Yup.array(entry),
onSubmit: (val) => {
//@ts-ignore
// @ts-ignore
setContainer((c) => ({
...c,
env: val,
Expand Down

0 comments on commit 4034a10

Please sign in to comment.