From 0efce9be969aecd0d7bfc59c410e55885d36141c Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Wed, 19 Aug 2020 19:25:17 +0200 Subject: [PATCH] Offline mode --- .../UserInterfaceState.xcuserstate | Bin 12503 -> 26493 bytes CapCollector/AppDelegate.swift | 3 +- CapCollector/Base.lproj/Main.storyboard | 2 +- CapCollector/Data/Database.swift | 27 +++++++++++++----- CapCollector/TableView.swift | 9 +++++- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/CapCollector.xcodeproj/project.xcworkspace/xcuserdata/imac.xcuserdatad/UserInterfaceState.xcuserstate b/CapCollector.xcodeproj/project.xcworkspace/xcuserdata/imac.xcuserdatad/UserInterfaceState.xcuserstate index 976a93b936bc8dda44c704074b1f687e08250b28..c702d5e0f859bcaea8192394447848f13dcde28a 100644 GIT binary patch literal 26493 zcmeIacU+TK+c!CN2oa({FbOKo`&O%UYptu=T5wja zc34-fwN`6~wRP62wOXsyYSj)`?f72jz6nF^^Stl#`@R1?@Clrpd7X2vbDe9R5p~rj zt1UeI6vBu?G-42oB*+0d4-Ot{v{+5%+Tvh?rM$`n-}J#YbKT%z^N3N#a+}o);hC?N zNj>s(*~SKAMQU@Up&8qd(A}n8gy@6?emdxI6BFgK#kJiF@JRxDOtHBXJat#z{CCr{D~niHBnY9)Zho z1vcW5xDr=k6CQ%xlnSH5sdy@ZN~Dsg3@Ve-P+63oDx!+1 zp;Qf3OPQ%UY7Awe#!?N`1Zpxhg_=e^PtBtiQY)y{)XUU%>J92m>MiPRY6tZWwUhdk z`iweCeNG*tzM#IOj#DS7@2D%(_taJD8ubHpo%)@6O#MOqN&Q9rO(Po96zxbm(Vnyy z?M?g8o#`%gPr4U9fR3PJ>0~;EPNy|=0bNMz=rVdZZJ-e8!w+&M;pwmznRFE6n%Ib>1*uK4SlrU8*^UFc|IgS7jq9S7ALQ>)C~oq?x+U};#f|?IdG1g6X(piaIT!&Yp5scg?ghts4wb= z`lA6TgmdRSxE0(gZVPve`+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@hAKmiVXEP2!#u-_hL;Ts3~w0L z8X6574DT8~GF&uV50i%3!s5d+!-j+vgiQ&1A?&5F`C$vg7KbefTN?Iu*qX52VPA!v z5BtkVjIqW9<0#`eV~KI1vCR0C(QBMzeAZ)}Yn*RfXk2VuVq9vhGj2ETGd3B&F`hJj zYdmkfZ$c(wa+$iA3QaX8pQ*vL#dO5fWIAp-VLD|xZ8~E*YdUATWx8#;W4dd)Z$@UB zS!33j4Q8X+Y_^(PnOmD<&27z{%xUIyb2oE8^8jB_?PKj8d!2oU{Y(3P`vLo5`%(Kb`_J}2?4H~9JNA3_2Lcx40xzfqt)Lg2 zLMx%Q5G%A5QiN2YgV0Gx6M71Rgb~6hAzvsE#tRdKQlVU!Bup2c6Xppo3iE}9!eZfd zp-xyStQOV?>xB1(ox(0*x3EXpFB}jK2}gt`;XC27@SAW$xGCHc?g($~n{NaX#am>wLlalJhm^Th3Z%y>pGT z(fN*Zqw{0uF6U>?FPvXF_d8EIPdmSNo^xJs{^b1KdCPg*`M2}F3%NL#%B6AXT}GGL z73qq0#kktK5?o2HuC7d1PgieOUspfZNY^OWXxA85nQM}(D$O;;HQhDC^|ot`Yptu% j^@Zz@>qOMrsP$3XqCSh-*WBn5(tM}CH{XN5QAhp{k-t^u diff --git a/CapCollector/AppDelegate.swift b/CapCollector/AppDelegate.swift index 4cee8b1..a45792a 100644 --- a/CapCollector/AppDelegate.swift +++ b/CapCollector/AppDelegate.swift @@ -97,8 +97,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func applicationDidBecomeActive(_ application: UIApplication) { - app.database?.uploadRemainingCaps() - app.database?.uploadRemainingImages() + app.database?.uploadRemainingData() guard shouldLaunchCamera else { return } shouldLaunchCamera = false diff --git a/CapCollector/Base.lproj/Main.storyboard b/CapCollector/Base.lproj/Main.storyboard index b292b11..9b4a01e 100644 --- a/CapCollector/Base.lproj/Main.storyboard +++ b/CapCollector/Base.lproj/Main.storyboard @@ -170,7 +170,7 @@ - + diff --git a/CapCollector/Data/Database.swift b/CapCollector/Data/Database.swift index 3df9180..6c6c7ab 100644 --- a/CapCollector/Data/Database.swift +++ b/CapCollector/Data/Database.swift @@ -300,7 +300,7 @@ final class Database { guard update("name", for: cap, setter: Cap.columnName <- name, Cap.columnUploaded <- false) else { return false } - uploadRemainingCaps() + uploadRemainingData() return true } @@ -659,27 +659,40 @@ final class Database { } } - func uploadRemainingCaps() { + func uploadRemainingData() { + guard !isInOfflineMode else { + log("Not uploading pending data due to offline mode") + return + } let uploads = self.pendingCapUploads guard uploads.count > 0 else { log("No pending cap uploads") + uploadRemainingImages() return } log("\(uploads.count) cap uploads pending") + var remaining = uploads.count for cap in uploads { upload.upload(name: cap.name, for: cap.id) { success in - guard success else { + if success { + self.log("Uploaded cap \(cap.id)") + self.update(uploaded: true, for: cap.id) + } else { self.log("Failed to upload cap \(cap.id)") - return } - self.log("Uploaded cap \(cap.id)") - self.update(uploaded: true, for: cap.id) + + remaining -= 1 + if remaining == 0 { + DispatchQueue.main.async { + self.uploadRemainingImages() + } + } } } } - func uploadRemainingImages() { + private func uploadRemainingImages() { let uploads = pendingImageUploads guard uploads.count > 0 else { log("No pending image uploads") diff --git a/CapCollector/TableView.swift b/CapCollector/TableView.swift index 637e9f0..7725f05 100644 --- a/CapCollector/TableView.swift +++ b/CapCollector/TableView.swift @@ -336,7 +336,14 @@ class TableView: UITableViewController { private func showOfflineDialog() { let offline = app.database.isInOfflineMode if offline { - + print("Marking as online") + app.database.isInOfflineMode = false + app.database.uploadRemainingData() + self.showAlert("Offline mode was disabled", title: "Online") + } else { + print("Marking as offline") + app.database.isInOfflineMode = true + self.showAlert("Offline mode was enabled", title: "Offline") } }