Skip to content

Commit b789b68

Browse files
authored
chore: run npm run fmt to fix lint errors (#8516)
1 parent 7217b52 commit b789b68

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

android/capacitor/src/main/java/com/getcapacitor/BridgeWebChromeClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public boolean onShowFileChooser(
282282
boolean captureEnabled = fileChooserParams.isCaptureEnabled();
283283
boolean capturePhoto = captureEnabled && acceptTypes.contains("image/*");
284284
final boolean captureVideo = captureEnabled && acceptTypes.contains("video/*");
285-
if ((capturePhoto || captureVideo)) {
285+
if (capturePhoto || captureVideo) {
286286
if (isMediaCaptureSupported()) {
287287
showMediaCaptureOrFilePicker(filePathCallback, fileChooserParams, captureVideo);
288288
} else {
@@ -447,7 +447,7 @@ public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
447447
}
448448

449449
public boolean isValidMsg(String msg) {
450-
return !(msg.contains("%cresult %c") || (msg.contains("%cnative %c")) || msg.equalsIgnoreCase("console.groupEnd"));
450+
return !(msg.contains("%cresult %c") || msg.contains("%cnative %c") || msg.equalsIgnoreCase("console.groupEnd"));
451451
}
452452

453453
private Uri createImageFileUri() throws IOException {

android/capacitor/src/main/java/com/getcapacitor/FileUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private static String getCopyFilePath(Uri uri, Context context) {
218218
Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
219219
int nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
220220
cursor.moveToFirst();
221-
String name = (cursor.getString(nameIndex));
221+
String name = cursor.getString(nameIndex);
222222
String fileName = sanitizeFilename(name);
223223
File file = new File(context.getFilesDir(), fileName);
224224
try {

android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private boolean isErrorUrl(Uri uri) {
221221
}
222222

223223
private boolean isMainUrl(Uri loadingUrl) {
224-
return (bridge.getServerUrl() == null && loadingUrl.getHost().equalsIgnoreCase(bridge.getHost()));
224+
return bridge.getServerUrl() == null && loadingUrl.getHost().equalsIgnoreCase(bridge.getHost());
225225
}
226226

227227
private boolean isAllowedUrl(Uri loadingUrl) {
@@ -722,31 +722,31 @@ private InputStream getInputStream() {
722722
@Override
723723
public int available() throws IOException {
724724
InputStream is = getInputStream();
725-
return (is != null) ? is.available() : -1;
725+
return is != null ? is.available() : -1;
726726
}
727727

728728
@Override
729729
public int read() throws IOException {
730730
InputStream is = getInputStream();
731-
return (is != null) ? is.read() : -1;
731+
return is != null ? is.read() : -1;
732732
}
733733

734734
@Override
735735
public int read(byte[] b) throws IOException {
736736
InputStream is = getInputStream();
737-
return (is != null) ? is.read(b) : -1;
737+
return is != null ? is.read(b) : -1;
738738
}
739739

740740
@Override
741741
public int read(byte[] b, int off, int len) throws IOException {
742742
InputStream is = getInputStream();
743-
return (is != null) ? is.read(b, off, len) : -1;
743+
return is != null ? is.read(b, off, len) : -1;
744744
}
745745

746746
@Override
747747
public long skip(long n) throws IOException {
748748
InputStream is = getInputStream();
749-
return (is != null) ? is.skip(n) : 0;
749+
return is != null ? is.skip(n) : 0;
750750
}
751751
}
752752

android/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookieManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ public void flush() {
192192
@Override
193193
public void put(URI uri, Map<String, List<String>> responseHeaders) {
194194
// make sure our args are valid
195-
if ((uri == null) || (responseHeaders == null)) return;
195+
if (uri == null || responseHeaders == null) return;
196196

197197
// go over the headers
198198
for (String headerKey : responseHeaders.keySet()) {
199199
// ignore headers which aren't cookie related
200-
if ((headerKey == null) || !(headerKey.equalsIgnoreCase("Set-Cookie2") || headerKey.equalsIgnoreCase("Set-Cookie"))) continue;
200+
if (headerKey == null || !(headerKey.equalsIgnoreCase("Set-Cookie2") || headerKey.equalsIgnoreCase("Set-Cookie"))) continue;
201201

202202
// process each of the headers
203203
for (String headerValue : Objects.requireNonNull(responseHeaders.get(headerKey))) {
@@ -215,7 +215,7 @@ public void put(URI uri, Map<String, List<String>> responseHeaders) {
215215
@Override
216216
public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) {
217217
// make sure our args are valid
218-
if ((uri == null) || (requestHeaders == null)) throw new IllegalArgumentException("Argument is null");
218+
if (uri == null || requestHeaders == null) throw new IllegalArgumentException("Argument is null");
219219

220220
// save our url once
221221
String url = uri.toString();

android/capacitor/src/main/java/com/getcapacitor/plugin/util/HttpRequestHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ public HttpURLConnectionBuilder setUrlParams(JSObject params, boolean shouldEnco
168168
"://" +
169169
uri.getAuthority() +
170170
uri.getPath() +
171-
((!urlQuery.equals("")) ? "?" + urlQuery : "") +
172-
((uri.getFragment() != null) ? uri.getFragment() : "");
171+
(!urlQuery.equals("") ? "?" + urlQuery : "") +
172+
(uri.getFragment() != null ? uri.getFragment() : "");
173173
this.url = new URL(unEncodedUrlString);
174174

175175
return this;

0 commit comments

Comments
 (0)