diff --git a/src/ui/pages/app-detail-service-scale.tsx b/src/ui/pages/app-detail-service-scale.tsx
index 87df5f9a9..54a74efc5 100644
--- a/src/ui/pages/app-detail-service-scale.tsx
+++ b/src/ui/pages/app-detail-service-scale.tsx
@@ -859,7 +859,7 @@ const LastScaleBanner = ({ serviceId }: { serviceId: string }) => {
const prev = useSelector((s) =>
selectPreviousServiceScale(s, { id: serviceId }),
);
- const neverScaled = current.status === "unknown";
+ const noScaleFound = current.status === "unknown";
const currentComplete = current.status === "succeeded";
const action = pollServiceOperations({ id: serviceId });
const loader = useLoader(action);
@@ -868,23 +868,30 @@ const LastScaleBanner = ({ serviceId }: { serviceId: string }) => {
const cancel = useMemo(() => cancelServicesOpsPoll(), []);
usePoller({ action: poller, cancel });
+ let tail = getScaleText(current);
+ if (prev.id !== "") {
+ tail = `from ${getScaleText(prev)} to ${tail}`;
+ }
+
if (loader.isInitialLoading) {
return null;
}
+ if (noScaleFound) {
+ return null;
+ }
+
+ if (!currentComplete) {
+ return (
+
+ Scale in Progress {getScaleText(current)}
+
+ );
+ }
+
return (
-
- {neverScaled ? (
- "Never Scaled"
- ) : (
- <>
-
- {currentComplete ? "Last Scale" : "Scale in Progress"}:
- {" "}
- {prettyDateTime(current.createdAt)} from {getScaleText(prev)} to{" "}
- {getScaleText(current)}
- >
- )}
+
+ Last Scale {prettyDateTime(current.createdAt)} {tail}
);
};