Skip to content

Commit

Permalink
fix: lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Aug 16, 2023
1 parent 82587a8 commit 12640fb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -921,25 +921,27 @@ public void run() {
CapacitorUpdater.TAG,
"Latest bundle already exists and download is NOT required. Update will occur next time app moves to background."
);
if(CapacitorUpdaterPlugin.this.directUpdate) {
CapacitorUpdaterPlugin.this.implementation.set(latest);
CapacitorUpdaterPlugin.this._reload();
final JSObject ret = new JSObject();
ret.put("bundle", latest.toJSON());
CapacitorUpdaterPlugin.this.notifyListeners(
"appReady",
ret
);
if (CapacitorUpdaterPlugin.this.directUpdate) {
CapacitorUpdaterPlugin.this.implementation.set(
latest
);
CapacitorUpdaterPlugin.this._reload();
final JSObject ret = new JSObject();
ret.put("bundle", latest.toJSON());
CapacitorUpdaterPlugin.this.notifyListeners(
"appReady",
ret
);
} else {
final JSObject ret = new JSObject();
ret.put("bundle", latest.toJSON());
CapacitorUpdaterPlugin.this.notifyListeners(
"updateAvailable",
ret
);
CapacitorUpdaterPlugin.this.implementation.setNextBundle(
latest.getId()
);
final JSObject ret = new JSObject();
ret.put("bundle", latest.toJSON());
CapacitorUpdaterPlugin.this.notifyListeners(
"updateAvailable",
ret
);
CapacitorUpdaterPlugin.this.implementation.setNextBundle(
latest.getId()
);
}
return;
}
Expand Down
8 changes: 4 additions & 4 deletions ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ 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 = self.implementation.getBundleInfoByVersionName(version: latestVersionName)
if (next == nil || ((next?.isDeleted()) != nil)) {
if ((next?.isDeleted()) != nil) {
if next == nil || ((next?.isDeleted()) != nil) {
if (next?.isDeleted()) != nil {
print("\(self.implementation.TAG) Latest bundle already exists and will be deleted, download will overwrite it.")
let res = self.implementation.delete(id: next!.getId(), removeInfo: true)
if !res {
Expand All @@ -550,7 +550,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
self.endBackGroundTask()
return
}
if (next.isErrorStatus()) {
if next.isErrorStatus() {
print("\(self.implementation.TAG) Latest version is in error state. Aborting update.")
self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
self.endBackGroundTask()
Expand All @@ -566,7 +566,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
}
throw ObjectSavableError.checksum
}
if (self.directUpdate) {
if self.directUpdate {
self.implementation.set(bundle: next)
self._reload()
} else {
Expand Down
12 changes: 6 additions & 6 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,14 @@ export interface CapacitorUpdaterPlugin {
*
* @since 5.1.0
*/
addListener(
eventName: "appReady",
listenerFunc: AppReadyListener
): Promise<PluginListenerHandle> & PluginListenerHandle;
addListener(
eventName: "appReady",
listenerFunc: AppReadyListener
): Promise<PluginListenerHandle> & PluginListenerHandle;

/**
* Get the native app version or the builtin version if set in config
*
*
* @returns {Promise<{ version: string }>} an Promise with version for this device
* @since 5.2.0
*/
Expand Down

0 comments on commit 12640fb

Please sign in to comment.