fix(deploy): redeploy button after save, disable save when clean, success toast
- Bug 1: default serverDirtyAgainstDeploy to true (not false) while dirtyState query is loading — prevents the button showing 'Save' instead of 'Redeploy' on apps with no successful deployment yet. - Bug 2: normalize samplingRate from server as '<n>.0' when the value is a whole-number float so serverState matches form after save, eliminating spurious dirty detection that kept Save enabled. - Bug 3: add success toast after handleSave completes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -113,7 +113,7 @@ export default function AppDeploymentPage() {
|
||||
const dirty = useFormDirty(form, serverState, stagedJar);
|
||||
const { dialogOpen: blockerOpen, confirm: blockerConfirm, cancel: blockerCancel } =
|
||||
useUnsavedChangesBlocker(dirty.anyLocalEdit);
|
||||
const serverDirtyAgainstDeploy = dirtyState?.dirty ?? false;
|
||||
const serverDirtyAgainstDeploy = dirtyState?.dirty ?? true;
|
||||
const deploymentInProgress = !!activeDeployment;
|
||||
const primaryMode = computeMode({
|
||||
deploymentInProgress,
|
||||
@@ -220,6 +220,8 @@ export default function AppDeploymentPage() {
|
||||
|
||||
setStagedJar(null);
|
||||
|
||||
toast({ title: 'Configuration saved', variant: 'success' });
|
||||
|
||||
// Invalidate dirty-state so the button reflects the new saved state
|
||||
await queryClient.invalidateQueries({ queryKey: ['apps', envSlug, targetApp.slug, 'dirty-state'] });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user