Skip to content

Commit

Permalink
fix onyx
Browse files Browse the repository at this point in the history
  • Loading branch information
waterim committed Sep 29, 2024
1 parent c132172 commit 2837a92
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/libs/shouldRenderTransferOwnerButton/index.native.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import isEmpty from 'lodash/isEmpty';
import {useOnyx} from 'react-native-onyx';
import Onyx, {OnyxEntry, useOnyx} from 'react-native-onyx';

Check failure on line 2 in src/libs/shouldRenderTransferOwnerButton/index.native.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Imports "OnyxEntry" are only used as type

Check failure on line 2 in src/libs/shouldRenderTransferOwnerButton/index.native.ts

View workflow job for this annotation

GitHub Actions / ESLint check

'useOnyx' is defined but never used

Check failure on line 2 in src/libs/shouldRenderTransferOwnerButton/index.native.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Imports "OnyxEntry" are only used as type

Check failure on line 2 in src/libs/shouldRenderTransferOwnerButton/index.native.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'useOnyx' is defined but never used
import ONYXKEYS from '@src/ONYXKEYS';
import {FundList} from '@src/types/onyx';

Check failure on line 4 in src/libs/shouldRenderTransferOwnerButton/index.native.ts

View workflow job for this annotation

GitHub Actions / ESLint check

All imports in the declaration are only used as types. Use `import type`

Check failure on line 4 in src/libs/shouldRenderTransferOwnerButton/index.native.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

All imports in the declaration are only used as types. Use `import type`
import type ShouldRenderTransferOwnerButton from './types';

let fundList: OnyxEntry<FundList>;
Onyx.connect({
key: ONYXKEYS.FUND_LIST,
callback: (value) => {
if (!value) {
return;
}

fundList = value;
},
});

const shouldRenderTransferOwnerButton: ShouldRenderTransferOwnerButton = () => {
const [fundList] = useOnyx(ONYXKEYS.FUND_LIST, {initialValue: {}});
return !isEmpty(fundList);
};

Expand Down

0 comments on commit 2837a92

Please sign in to comment.