Skip to content

Commit 8189b78

Browse files
committed
AccountPickScreen [nfc]: s/accounts/accountStatuses/
This makes more sense; the objects are `AccountStatus`es, not `Account`s.
1 parent f30bd01 commit 8189b78

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/account/AccountList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import ViewPlaceholder from '../common/ViewPlaceholder';
88
import AccountItem from './AccountItem';
99

1010
type Props = $ReadOnly<{|
11-
accounts: $ReadOnlyArray<AccountStatus>,
11+
accountStatuses: $ReadOnlyArray<AccountStatus>,
1212
onAccountSelect: number => Promise<void> | void,
1313
onAccountRemove: number => Promise<void> | void,
1414
|}>;
1515

1616
export default function AccountList(props: Props): Node {
17-
const { accounts, onAccountSelect, onAccountRemove } = props;
17+
const { accountStatuses, onAccountSelect, onAccountRemove } = props;
1818

1919
return (
2020
<View>
2121
<FlatList
22-
data={accounts}
22+
data={accountStatuses}
2323
keyExtractor={item => `${item.email}${item.realm.toString()}`}
2424
ItemSeparatorComponent={() => <ViewPlaceholder height={8} />}
2525
renderItem={({ item, index }) => (

src/account/AccountPickScreen.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ type Props = $ReadOnly<{|
2626

2727
export default function AccountPickScreen(props: Props): Node {
2828
const { navigation } = props;
29-
const accounts = useGlobalSelector(getAccountStatuses);
29+
const accountStatuses = useGlobalSelector(getAccountStatuses);
3030
const dispatch = useGlobalDispatch();
3131
const _ = useContext(TranslationContext);
3232

3333
const handleAccountSelect = useCallback(
3434
async (index: number) => {
35-
const { realm, isLoggedIn } = accounts[index];
35+
const { realm, isLoggedIn } = accountStatuses[index];
3636
if (isLoggedIn) {
3737
setTimeout(() => {
3838
dispatch(accountSwitch(index));
@@ -47,12 +47,12 @@ export default function AccountPickScreen(props: Props): Node {
4747
}
4848
}
4949
},
50-
[accounts, dispatch, navigation, _],
50+
[accountStatuses, dispatch, navigation, _],
5151
);
5252

5353
const handleAccountRemove = useCallback(
5454
(index: number) => {
55-
const { realm, email } = accounts[index];
55+
const { realm, email } = accountStatuses[index];
5656
showConfirmationDialog({
5757
destructive: true,
5858
title: 'Remove account',
@@ -66,7 +66,7 @@ export default function AccountPickScreen(props: Props): Node {
6666
_,
6767
});
6868
},
69-
[accounts, _, dispatch],
69+
[accountStatuses, _, dispatch],
7070
);
7171

7272
return (
@@ -78,9 +78,9 @@ export default function AccountPickScreen(props: Props): Node {
7878
shouldShowLoadingBanner={false}
7979
>
8080
<Centerer>
81-
{accounts.length === 0 && <Logo />}
81+
{accountStatuses.length === 0 && <Logo />}
8282
<AccountList
83-
accounts={accounts}
83+
accountStatuses={accountStatuses}
8484
onAccountSelect={handleAccountSelect}
8585
onAccountRemove={handleAccountRemove}
8686
/>

0 commit comments

Comments
 (0)