|
@@ -5,6 +5,7 @@ import { Context } from "shared/Context";
|
|
|
import { NewWebsocketOptions, useWebsockets } from "shared/hooks/useWebsockets";
|
|
import { NewWebsocketOptions, useWebsockets } from "shared/hooks/useWebsockets";
|
|
|
import { ChartType } from "shared/types";
|
|
import { ChartType } from "shared/types";
|
|
|
import yaml from "js-yaml";
|
|
import yaml from "js-yaml";
|
|
|
|
|
+import { usePrevious } from "shared/hooks/usePrevious";
|
|
|
|
|
|
|
|
const PORTER_IMAGE_TEMPLATES = [
|
|
const PORTER_IMAGE_TEMPLATES = [
|
|
|
"porterdev/hello-porter-job",
|
|
"porterdev/hello-porter-job",
|
|
@@ -26,6 +27,8 @@ export const useJobs = (chart: ChartType) => {
|
|
|
"loading" | "successful" | string
|
|
"loading" | "successful" | string
|
|
|
>("");
|
|
>("");
|
|
|
|
|
|
|
|
|
|
+ const previousChart = usePrevious(chart, null);
|
|
|
|
|
+
|
|
|
const {
|
|
const {
|
|
|
newWebsocket,
|
|
newWebsocket,
|
|
|
openWebsocket,
|
|
openWebsocket,
|
|
@@ -203,6 +206,17 @@ export const useJobs = (chart: ChartType) => {
|
|
|
closeAllWebsockets();
|
|
closeAllWebsockets();
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (
|
|
|
|
|
+ previousChart?.name === chart?.name &&
|
|
|
|
|
+ previousChart?.namespace === chart?.namespace
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return () => {
|
|
|
|
|
+ isSubscribed = false;
|
|
|
|
|
+ closeAllWebsockets();
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
setStatus("loading");
|
|
setStatus("loading");
|
|
|
const newestImage = chart?.config?.image?.repository;
|
|
const newestImage = chart?.config?.image?.repository;
|
|
|
|
|
|