Skip to content

Commit 1ba113f

Browse files
committed
linting fixes
1 parent 7376915 commit 1ba113f

File tree

8 files changed

+69
-77
lines changed

8 files changed

+69
-77
lines changed

src/components/hiveAuthModal/children/authInputContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const AuthInputContent = ({ initUsername, handleAuthRequest }: AuthInputC
8080
<Animated.View entering={ZoomIn} exiting={ZoomOut}>
8181
<MainButton
8282
text={intl.formatMessage({ id: 'login.signin_with_hiveauth' })}
83-
secondText=" *beta"
83+
secondText=""
8484
textStyle={styles.loginBtnText}
8585
style={styles.loginBtnWrapper}
8686
onPress={onSignInPress}

src/components/sideMenu/view/sideMenuView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ const SideMenuView = ({
194194
name="expand-less"
195195
color={EStyleSheet.value('$iconColor')}
196196
size={18}
197-
></Icon>
197+
/>
198198
<Text style={styles.vpText}>{upower}</Text>
199199
</View>
200200
</View>

src/components/transferAccountSelector/transferAccountSelector.tsx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ const TransferAccountSelector = ({
7070
}
7171
}, [transferType]);
7272

73-
74-
const allowMultipleDest = transferType === TransferTypes.TRANSFER_TOKEN
75-
|| transferType === TransferTypes.POINTS;
73+
const allowMultipleDest =
74+
transferType === TransferTypes.TRANSFER_TOKEN || transferType === TransferTypes.POINTS;
7675

7776
const _handleOnFromUserChange = (username) => {
7877
fetchBalance(username);
@@ -90,7 +89,6 @@ const TransferAccountSelector = ({
9089

9190
const _debouncedValidateUsername = useCallback(
9291
debounce(async (usernames: string[]) => {
93-
9492
if (usernames.length === 0) {
9593
console.log('No usernames provided.');
9694
setIsUsernameValid(false); // No usernames means invalid
@@ -105,23 +103,23 @@ const TransferAccountSelector = ({
105103
// Query the username and check if it exists
106104
const users = await getAccountsWithUsername(trimmedUsername);
107105
const _isValid = users.includes(username);
108-
if(_isValid){
106+
if (_isValid) {
109107
getRecurrentTransferOfUser(username);
110108
}
111-
return _isValid // Convert result to boolean (true if valid, false otherwise)
109+
return _isValid; // Convert result to boolean (true if valid, false otherwise)
112110
} catch (error) {
113111
console.error(`Error validating username "${trimmedUsername}":`, error);
114112
return false; // Treat query errors as invalid
115113
}
116-
})
114+
}),
117115
);
118116

119117
if (usernames.toString() !== destinationRef.current.toString()) {
120118
return;
121119
}
122120

123121
// Step 3: Check if all usernames are valid
124-
const isValid = validationResults.every(result => result);
122+
const isValid = validationResults.every((result) => result);
125123

126124
// Step 4: Set the isUsernameValid flag
127125
setIsUsernameValid(isValid);
@@ -130,7 +128,6 @@ const TransferAccountSelector = ({
130128
console.log('Extracted Usernames:', usernames);
131129
console.log('Validation Results:', validationResults);
132130
console.log('Is All Usernames Valid:', isValid);
133-
134131
}, 300),
135132
[getRecurrentTransferOfUser],
136133
);
@@ -181,10 +178,10 @@ const TransferAccountSelector = ({
181178
state === 'destination'
182179
? destination
183180
: state === 'amount'
184-
? amount
185-
: state === 'memo'
186-
? memo
187-
: ''
181+
? amount
182+
: state === 'memo'
183+
? memo
184+
: ''
188185
}
189186
placeholder={placeholder}
190187
placeholderTextColor="#c1c5c7"
@@ -248,15 +245,19 @@ const TransferAccountSelector = ({
248245
<View style={styles.toFromAvatarsContainer}>
249246
<UserAvatar username={from} size="xl" style={styles.userAvatar} noAction />
250247
<Icon style={styles.icon} name="arrow-forward" iconType="MaterialIcons" />
251-
{
252-
destinationRef.current.length > 0 ? (
253-
destinationRef.current.map((username, index) => (
254-
<UserAvatar key={username} username={username} size="xl" style={{...styles.userAvatar, marginLeft: index && -48}} noAction />
255-
))
256-
) : (
257-
<UserAvatar username={''} size="xl" style={styles.userAvatar} noAction />
258-
)
259-
}
248+
{destinationRef.current.length > 0 ? (
249+
destinationRef.current.map((username, index) => (
250+
<UserAvatar
251+
key={username}
252+
username={username}
253+
size="xl"
254+
style={{ ...styles.userAvatar, marginLeft: index && -48 }}
255+
noAction
256+
/>
257+
))
258+
) : (
259+
<UserAvatar username="" size="xl" style={styles.userAvatar} noAction />
260+
)}
260261
</View>
261262
</View>
262263
);

src/providers/hive/dhive.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ export const transferToken = (currentAccount, pin, data) => {
11231123
if (key) {
11241124
const privateKey = PrivateKey.fromString(key);
11251125

1126-
const destinationInput = data.destination
1126+
const destinationInput = data.destination;
11271127

11281128
// Split the destination input into an array of usernames
11291129
// Handles both spaces and commas as separators
@@ -1135,11 +1135,11 @@ export const transferToken = (currentAccount, pin, data) => {
11351135
const baseArgs = {
11361136
from: data.from,
11371137
amount: data.amount,
1138-
memo: data.memo
1138+
memo: data.memo,
11391139
};
11401140

11411141
// Create a transfer operation for each destination username
1142-
const opArray = destinations.map(destination => {
1142+
const opArray = destinations.map((destination) => {
11431143
const args = { ...baseArgs, to: destination.trim() }; // Trim whitespace
11441144
return ['transfer', args];
11451145
});
@@ -1942,11 +1942,10 @@ export const transferPoint = (currentAccount, pinCode, data) => {
19421942
const key = getActiveKey(get(currentAccount, 'local'), pin);
19431943
const username = get(currentAccount, 'name');
19441944

1945-
19461945
if (key) {
19471946
const privateKey = PrivateKey.fromString(key);
19481947

1949-
const destinationInput = data.destination
1948+
const destinationInput = data.destination;
19501949

19511950
// Split the destination input into an array of usernames
19521951
// Handles both spaces and commas as separators
@@ -1962,7 +1961,7 @@ export const transferPoint = (currentAccount, pinCode, data) => {
19621961
};
19631962

19641963
// Create a transfer operation for each destination username
1965-
const opArray = destinations.map(destination => {
1964+
const opArray = destinations.map((destination) => {
19661965
const json = JSON.stringify({ ...baseArgs, receiver: destination.trim() }); // Trim whitespace
19671966
const op = {
19681967
id: 'ecency_point_transfer',

src/screens/application/hook/useInitApplication.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@ import { useEffect, useMemo, useRef } from 'react';
22
import Orientation, { useDeviceOrientationChange } from 'react-native-orientation-locker';
33
import { isLandscape } from 'react-native-device-info';
44
import EStyleSheet from 'react-native-extended-stylesheet';
5-
import {
6-
Appearance,
7-
AppState,
8-
NativeEventSubscription,
9-
Platform,
10-
useColorScheme,
11-
} from 'react-native';
12-
import notifee, { EventType } from '@notifee/react-native';
5+
import { Appearance, AppState, NativeEventSubscription, useColorScheme } from 'react-native';
6+
import notifee from '@notifee/react-native';
137
import { isEmpty, some, get } from 'lodash';
148
import { getMessaging } from '@react-native-firebase/messaging';
159
import BackgroundTimer from 'react-native-background-timer';
@@ -128,19 +122,19 @@ export const useInitApplication = () => {
128122

129123
// on android messaging event work fine for both background and quite state
130124
// while notifee events do not fuction as expected
131-
132-
messagingEventRef.current = getMessaging().onNotificationOpenedApp((remoteMessage) => {
133-
console.log('Notificaiton opened app', remoteMessage);
134-
_pushNavigate(remoteMessage);
135-
});
136125

137-
const initialNotification = await getMessaging().getInitialNotification();
138-
if (initialNotification) {
139-
console.log('Initial Notification', initialNotification);
140-
_pushNavigate(initialNotification);
141-
}
126+
messagingEventRef.current = getMessaging().onNotificationOpenedApp((remoteMessage) => {
127+
console.log('Notificaiton opened app', remoteMessage);
128+
_pushNavigate(remoteMessage);
129+
});
142130

143-
//NOTE: notifee seems to have been malfunctioning, avoid using for testing
131+
const initialNotification = await getMessaging().getInitialNotification();
132+
if (initialNotification) {
133+
console.log('Initial Notification', initialNotification);
134+
_pushNavigate(initialNotification);
135+
}
136+
137+
// NOTE: notifee seems to have been malfunctioning, avoid using for testing
144138
// } else if (Platform.OS === 'android') {
145139
// // for ios, notifee events work while messaging event are malfunctioning, the foreground event
146140
// // on ios is called if user opens/starts app from notification
@@ -150,7 +144,7 @@ export const useInitApplication = () => {
150144
// _pushNavigate(detail.notification);
151145
// }
152146
// });
153-
147+
154148
// }
155149
};
156150

src/screens/login/screen/loginScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const LoginScreen = ({
209209
id: 'login.signin_with_hiveauth',
210210
})}
211211
textStyle={styles.hsLoginBtnText}
212-
secondText=" *beta"
212+
secondText=""
213213
wrapperStyle={styles.loginBtnWrapper}
214214
bodyWrapperStyle={styles.loginBtnBodyWrapper}
215215
height={48}

src/screens/searchResult/screen/tabs/best/container/postsResultsContainer.tsx

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,34 @@ const PostsResultsContainer = ({ children, searchValue }) => {
2626
_fetchResults();
2727
}, [searchValue]);
2828

29-
3029
const _fetchResults = async () => {
31-
let _data:any = [];
30+
let _data: any = [];
3231

3332
setNoResult(false);
3433
setData(_data);
3534

36-
//parse author and permlink if url
37-
const { author, permlink } = postUrlParser(searchValue) || {}
38-
39-
//fetch based on post url
40-
if(author && permlink){
41-
const post = await getPost(author, permlink);
42-
_data = post ? [post] : [];
43-
}
44-
//search with query
45-
else if (searchValue) {
46-
const res = await search({ q: `${searchValue} type:post`, sort });
47-
_data = res.results || [];
48-
setScrollId(res.scroll_id);
49-
}
50-
//get initial posts if not search value
51-
else {
52-
_data = await getInitialPosts();
53-
}
54-
55-
setData(_data);
56-
setNoResult(_data.length === 0);
57-
}
35+
// parse author and permlink if url
36+
const { author, permlink } = postUrlParser(searchValue) || {};
5837

38+
// fetch based on post url
39+
if (author && permlink) {
40+
const post = await getPost(author, permlink);
41+
_data = post ? [post] : [];
42+
}
43+
// search with query
44+
else if (searchValue) {
45+
const res = await search({ q: `${searchValue} type:post`, sort });
46+
_data = res.results || [];
47+
setScrollId(res.scroll_id);
48+
}
49+
// get initial posts if not search value
50+
else {
51+
_data = await getInitialPosts();
52+
}
53+
54+
setData(_data);
55+
setNoResult(_data.length === 0);
56+
};
5957

6058
const getInitialPosts = async () => {
6159
const options = {

src/screens/searchResult/screen/tabs/people/container/peopleResultsContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const PeopleResultsContainer = ({ children, searchValue, isUsername }) => {
2525
_fetchUsernames(searchValue);
2626
}
2727

28-
//parse username if url is provided
29-
const {author} = postUrlParser(searchValue) || {}
28+
// parse username if url is provided
29+
const { author } = postUrlParser(searchValue) || {};
3030

3131
searchAccount(author || searchValue, 20, searchValue ? 0 : 1)
3232
.then((res) => {

0 commit comments

Comments
 (0)