Просмотр исходного кода

fix: show live only when subdomain and status is created

Soham Parekh 3 лет назад
Родитель
Сommit
14c1f1dc99

+ 20 - 19
dashboard/src/main/home/cluster-dashboard/preview-environments/deployments/DeploymentCard.tsx

@@ -271,25 +271,26 @@ const DeploymentCard: React.FC<{
               </>
               </>
             ) : null}
             ) : null}
 
 
-            {deployment.status !== DeploymentStatus.Creating && (
-              <>
-                <RowButton
-                  onClick={(e) => {
-                    e.preventDefault();
-                    e.stopPropagation();
-
-                    window.open(deployment.subdomain, "_blank");
-                  }}
-                  key={deployment.subdomain}
-                >
-                  <i className="material-icons">open_in_new</i>
-                  View Live
-                </RowButton>
-                <DeploymentCardActionsDropdown
-                  options={DeploymentCardActions}
-                />
-              </>
-            )}
+            {deployment.status === DeploymentStatus.Created &&
+              !deployment.subdomain && (
+                <>
+                  <RowButton
+                    onClick={(e) => {
+                      e.preventDefault();
+                      e.stopPropagation();
+
+                      window.open(deployment.subdomain, "_blank");
+                    }}
+                    key={deployment.subdomain}
+                  >
+                    <i className="material-icons">open_in_new</i>
+                    View Live
+                  </RowButton>
+                  <DeploymentCardActionsDropdown
+                    options={DeploymentCardActions}
+                  />
+                </>
+              )}
             {/* <Button
             {/* <Button
               onClick={() => {
               onClick={() => {
                 setCurrentOverlay({
                 setCurrentOverlay({