Skip to content

Commit

Permalink
fix: backport updateAvailable event
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 3, 2022
1 parent b09a792 commit d1c72b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public void run() {

final String url = (String) res.get("url");
final BundleInfo next = CapacitorUpdaterPlugin.this.implementation.download(url, latestVersionName);

this.notifyListeners("updateAvailable", next);
CapacitorUpdaterPlugin.this.implementation.setNextBundle(next.getId());
} catch (final Exception e) {
Log.e(CapacitorUpdater.TAG, "error downloading file", e);
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
do {
print("\(self.implementation.TAG) New bundle: \(latestVersionName!) found. Current is: \(current.getVersionName()). Update will occur next time app moves to background.")
let next = try self.implementation.download(url: downloadUrl, version: latestVersionName!)

self.notifyListeners("updateAvailable", data: ["version": next.toJSON()])
let _ = self.implementation.setNextBundle(next: next.getId())
} catch {
print("\(self.implementation.TAG) Error downloading file", error.localizedDescription)
Expand Down

0 comments on commit d1c72b6

Please sign in to comment.