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 2657caa commit 6d3df84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public void notifyListeners(final String id, final JSObject res) {
this.implementation.versionCode = Integer.toString(pInfo.versionCode);
this.implementation.requestQueue =
Volley.newRequestQueue(this.getContext());
this.implementation.directUpdate = this.getConfig().getBoolean("directUpdate", false);
this.implementation.directUpdate =
this.getConfig().getBoolean("directUpdate", false);
this.currentVersionNative =
new Version(this.getConfig().getString("version", pInfo.versionName));
} catch (final PackageManager.NameNotFoundException e) {
Expand Down Expand Up @@ -836,7 +837,9 @@ private boolean isValidURL(String urlStr) {
}

private void backgroundDownload() {
String messageUpdate = this.implementation.directUpdate ? "Update will occur now." : "Update will occur next time app moves to background.";
String messageUpdate = this.implementation.directUpdate
? "Update will occur now."
: "Update will occur next time app moves to background.";
new Thread(
new Runnable() {
@Override
Expand Down Expand Up @@ -919,9 +922,12 @@ public void run() {
if (latest.isDownloaded()) {
Log.i(
CapacitorUpdater.TAG,
"Latest bundle already exists and download is NOT required. " + messageUpdate
"Latest bundle already exists and download is NOT required. " +
messageUpdate
);
if (CapacitorUpdaterPlugin.this.implementation.directUpdate) {
if (
CapacitorUpdaterPlugin.this.implementation.directUpdate
) {
CapacitorUpdaterPlugin.this.implementation.set(
latest
);
Expand Down Expand Up @@ -985,7 +991,8 @@ public void run() {
latestVersionName +
" found. Current is: " +
current.getVersionName() +
". " + messageUpdate
". " +
messageUpdate
);

final String url = res.getString("url");
Expand Down
2 changes: 1 addition & 1 deletion ios/Plugin/CapacitorUpdaterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin {
}

func backgroundDownload() {
let messageUpdate = self.directUpdate ? "Update will occur now." : "Update will occur next time app moves to background.";
let messageUpdate = self.directUpdate ? "Update will occur now." : "Update will occur next time app moves to background."
DispatchQueue.global(qos: .background).async {
self.backgroundTaskID = UIApplication.shared.beginBackgroundTask(withName: "Finish Download Tasks") {
// End the task if time expires.
Expand Down

0 comments on commit 6d3df84

Please sign in to comment.