Svilen Markov 4 mesiacov pred
rodič
commit
6a193d4246
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  1. 3 3
      internal/glance/widget-custom-api.go

+ 3 - 3
internal/glance/widget-custom-api.go

@@ -199,11 +199,11 @@ func fetchAndParseCustomAPI(
 				var data *customAPIResponseData
 				var data *customAPIResponseData
 				data, localErr = fetchCustomAPIRequest(ctx, req)
 				data, localErr = fetchCustomAPIRequest(ctx, req)
 				mu.Lock()
 				mu.Lock()
-				if localErr != nil && err == nil {
+				if localErr == nil {
+					subData[key] = data
+				} else if err == nil {
 					err = localErr
 					err = localErr
 					cancel()
 					cancel()
-				} else {
-					subData[key] = data
 				}
 				}
 				mu.Unlock()
 				mu.Unlock()
 			}()
 			}()