Skip to content

Commit

Permalink
fix(ios): set error flag to false for non-error actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ayewo committed Aug 18, 2023
1 parent 4fea5cb commit 74c0654
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,11 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
let current = self.implementation.getCurrentBundle()

if (res.message) != nil {
print("\(self.implementation.TAG) API message \(res.message ?? "")")
print("\(self.implementation.TAG) API response: \(res.message ?? "")")
if res.major == true {
self.notifyListeners("majorAvailable", data: ["version": res.version])
}
self.endBackGroundTaskWithNotif(msg: res.message ?? "", latestVersionName: res.version, current: current)
self.endBackGroundTaskWithNotif(msg: res.message ?? "", latestVersionName: res.version, current: current, error: false)
return
}
let sessionKey = res.sessionKey ?? ""
Expand Down Expand Up @@ -585,11 +585,11 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
_ = self.implementation.set(bundle: next)
_ = self._reload()
self.directUpdate = false
self.endBackGroundTaskWithNotif(msg: "update installed", latestVersionName: latestVersionName, current: current)
self.endBackGroundTaskWithNotif(msg: "update installed", latestVersionName: latestVersionName, current: current, error: false)
} else {
self.notifyListeners("updateAvailable", data: ["bundle": next.toJSON()])
_ = self.implementation.setNextBundle(next: next.getId())
self.endBackGroundTaskWithNotif(msg: "update downloaded, will install next background", latestVersionName: latestVersionName, current: current)
self.endBackGroundTaskWithNotif(msg: "update downloaded, will install next background", latestVersionName: latestVersionName, current: current, error: false)
}
return
} catch {
Expand Down

0 comments on commit 74c0654

Please sign in to comment.