diff --git a/Forms/StatusForm.cs b/Forms/StatusForm.cs index 4e4bb16..6fd769b 100755 --- a/Forms/StatusForm.cs +++ b/Forms/StatusForm.cs @@ -115,14 +115,17 @@ private void UpdateReceived(StatusResult status) } else { - var cacheFolderPath = string.Format("{0}\\.crc\\cache", - Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); + if (status.Success) + { + if (status.CrcStatus != "") + CrcStatus.Text = status.CrcStatus; - if (status.CrcStatus != "") - CrcStatus.Text = status.CrcStatus; + if (status.OpenshiftStatus != "") + OpenShiftStatus.Text = StatusText(status); + } - if (status.OpenshiftStatus != "") - OpenShiftStatus.Text = StatusText(status); + var cacheFolderPath = string.Format("{0}\\.crc\\cache", + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); DiskUsage.Text = string.Format("{0} of {1} (Inside the CRC VM)", FileSize.HumanReadable(status.DiskUse), FileSize.HumanReadable(status.DiskSize)); @@ -130,15 +133,6 @@ private void UpdateReceived(StatusResult status) CacheFolder.Text = cacheFolderPath; } } - else - { - // TODO: workaround for no VM - if (CrcStatus.InvokeRequired) - { - UpdateReceivedCallback c = UpdateReceived; - Invoke(c, new StatusResult { CrcStatus = InitialState, OpenshiftStatus = "Stopped"}); - } - } } private static string StatusText(StatusResult status) diff --git a/Helpers/Handlers.cs b/Helpers/Handlers.cs index 07fb800..b0297f7 100755 --- a/Helpers/Handlers.cs +++ b/Helpers/Handlers.cs @@ -89,13 +89,13 @@ public static StatusResult Status() { StatusResult result = getResultsOrDefault(DaemonCommander.Status); - if (StatusReceived != null) - StatusReceived(result); - // TODO: workaround for daemon returning 500/Error state when no VM exists if (result == null) return null; + if (StatusReceived != null) + StatusReceived(result); + lock (_statusChangeLock) { if (StatusChanged != null && _previousStatus != result.OpenshiftStatus)