Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
linter
Browse files Browse the repository at this point in the history
  • Loading branch information
redreceipt committed Oct 11, 2021
1 parent 92f015e commit a2c84ad
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
23 changes: 10 additions & 13 deletions apolloschurchapp/__mocks__/@react-native-community/async-storage.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
let cache = {};
export default {
setItem: (key, value) =>
new Promise(
(resolve, reject) =>
typeof key !== 'string' || typeof value !== 'string'
? reject(new Error('key and value must be string'))
: resolve((cache[key] = value))
new Promise((resolve, reject) =>
typeof key !== 'string' || typeof value !== 'string'
? reject(new Error('key and value must be string'))
: resolve((cache[key] = value))
),
getItem: (key, value) =>
new Promise(
(resolve) =>
cache.hasOwnProperty(key) ? resolve(cache[key]) : resolve(null)
new Promise((resolve) =>
cache.hasOwnProperty(key) ? resolve(cache[key]) : resolve(null)
),
removeItem: (key) =>
new Promise(
(resolve, reject) =>
cache.hasOwnProperty(key)
? resolve(delete cache[key])
: reject('No such key!')
new Promise((resolve, reject) =>
cache.hasOwnProperty(key)
? resolve(delete cache[key])
: reject('No such key!')
),
clear: (key) => new Promise((resolve, reject) => resolve((cache = {}))),

Expand Down
5 changes: 3 additions & 2 deletions apolloschurchapp/scripts/get-introspection-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ const getIntrospectionData = async () => {
} catch (e) {
if (attempts < maxAttempts) {
console.log(
`Error writing fragmentTypes (-api probably hasn't started yet). Trying again after wait. Attempt: ${attempts +
1} of ${maxAttempts}`
`Error writing fragmentTypes (-api probably hasn't started yet). Trying again after wait. Attempt: ${
attempts + 1
} of ${maxAttempts}`
);
await new Promise((resolve) => setTimeout(resolve, timeBetweenAttempts)); // try again after waiting
getIntrospectionData();
Expand Down
17 changes: 7 additions & 10 deletions apolloschurchapp/src/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,13 @@ const TabNavigator = () => {
// this is only used by the tab loaded first
// if there is a new version of the onboarding flow,
// we'll navigate there first to show new screens
useEffect(
() => {
checkOnboardingStatusAndNavigate({
client,
navigation: NavigationService,
navigateHome: false,
});
},
[client]
);
useEffect(() => {
checkOnboardingStatusAndNavigate({
client,
navigation: NavigationService,
navigateHome: false,
});
}, [client]);
return (
<Navigator lazy>
<Screen
Expand Down
8 changes: 6 additions & 2 deletions apolloschurchapp/src/user-settings/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,12 @@ const UserSettings = () => {
const firstName = get(data, 'currentUser.profile.firstName');
const lastName = get(data, 'currentUser.profile.lastName');

if (loading) return <ActivityIndicator />;
if (!isLoggedIn) return null;
if (loading) {
return <ActivityIndicator />;
}
if (!isLoggedIn) {
return null;
}
return (
<BackgroundView>
<ScrollView>
Expand Down

0 comments on commit a2c84ad

Please sign in to comment.