Skip to content

Commit

Permalink
ran npm format
Browse files Browse the repository at this point in the history
  • Loading branch information
reifl committed Aug 19, 2024
1 parent 10437c0 commit 104f4fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 29 deletions.
2 changes: 1 addition & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import custom from "./themes.json";
import { useFonts } from "expo-font";
import { EvaIconsPack } from "@ui-kitten/eva-icons";
import * as SplashScreen from "expo-splash-screen";
import {decode, encode} from 'base-64'
import { decode, encode } from "base-64";

if (!global.btoa) {
global.btoa = encode;
Expand Down
17 changes: 4 additions & 13 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"orientation": "default",
"icon": "./assets/icon-dark.png",
"userInterfaceStyle": "automatic",
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"splash": {
"image": "./assets/splash-light.png",
Expand All @@ -24,19 +22,14 @@
"supportsTablet": true,
"bundleIdentifier": "io.evcc.ios",
"infoPlist": {
"CFBundleLocalizations": [
"de"
],
"CFBundleLocalizations": ["de"],
"CFBundleDevelopmentRegion": "de",
"CFBundleAllowMixedLocalizations": true,
"NSLocalNetworkUsageDescription": "Die App benötigt Zugriff auf das lokale Netzwerk, um deine evcc Instanz zu finden.",
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
},
"NSBonjourServices": [
"_http._tcp.",
"_https._tcp."
]
"NSBonjourServices": ["_http._tcp.", "_https._tcp."]
},
"config": {
"usesNonExemptEncryption": false
Expand All @@ -55,9 +48,7 @@
"favicon": "./assets/favicon.png",
"build": {
"babel": {
"include": [
"@ui-kitten/components"
]
"include": ["@ui-kitten/components"]
}
}
},
Expand Down
24 changes: 9 additions & 15 deletions utils/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ export function cleanServerUrl(url) {
return result;
}



export async function verifyEvccServer(url, authOptions) {
try {
options = {
timeout: 10000
options = {
timeout: 10000,
};
if(authOptions)
{
if (authOptions) {
options.auth = {
username: authOptions.username,
password: authOptions.password
}
password: authOptions.password,
};
}

const response = await axios.get(url, options);
Expand All @@ -41,14 +38,11 @@ export async function verifyEvccServer(url, authOptions) {
}
}
console.log(data);
} catch (error) {
if(error instanceof AxiosError)
{
} catch (error) {
if (error instanceof AxiosError) {
var resp = error.response;
if(resp)
{
if(resp.status == 401)
{
if (resp) {
if (resp.status == 401) {
throw new Error("Missing Authentication");
}
}
Expand Down

0 comments on commit 104f4fb

Please sign in to comment.