diff LazyBear/Views/Company/Networking/Company.swift @ 440:01fa77358b82

Fixes #47
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Sun, 20 Jun 2021 16:58:36 +0200
parents 7f2a24a774eb
children 4b8031e696e8
line wrap: on
line diff
--- a/LazyBear/Views/Company/Networking/Company.swift	Sun Jun 20 14:31:39 2021 +0200
+++ b/LazyBear/Views/Company/Networking/Company.swift	Sun Jun 20 16:58:36 2021 +0200
@@ -10,9 +10,11 @@
 
 class Company: ObservableObject {
     @Published var showView = false
+    @Published var showChart = true  /// To show a ProgressView when the chart is refreshed (Date range selected)
     @Published var data = CompanyResponse()
     
     func request(_ url: String, _ requestType: RequestType) {
+        if requestType == .refresh { self.showChart = false }
         let bazooka = Bazooka()
         bazooka.request(url: url, model: CompanyResponse.self) { response in
             switch requestType {
@@ -25,6 +27,7 @@
             }
             
             self.showView = true
+            self.showChart = true
         }
     }
 }