Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoYhun committed Oct 4, 2023
1 parent e289755 commit e177d5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/pages/TrueSightV2/components/WatchlistButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ function WatchlistButton({
loading={false}
watched={!!assetId && !!watchlists && watchlists?.some(item => item.assetIds?.includes(+assetId))}
onClick={() => {
!isReachMaxLimit && setOpenMenu(prev => !prev)
!isReachMaxLimit && setOpenMenu(true)
}}
wrapperStyle={wrapperStyle}
size={size}
Expand All @@ -519,12 +519,12 @@ function WatchlistButton({
)

return (
<div onClick={e => e.stopPropagation()}>
<div onClick={e => e.stopPropagation()} ref={ref}>
<Popover
show={openMenu}
style={{ backgroundColor: theme.tableHeader, borderRadius: '20px' }}
content={
<MenuWrapper ref={ref}>
<MenuWrapper>
{watchlists?.map((watchlists: ICustomWatchlists) => {
const watched = !!assetId && !!watchlists.assetIds && watchlists.assetIds.includes(+assetId)
return (
Expand Down
7 changes: 4 additions & 3 deletions src/pages/TrueSightV2/hooks/useKyberAIData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const kyberAIApi = createApi({
transformResponse: (res: any) => {
return { data: res.data.assets, totalItems: res.data.pagination.totalItems }
},
providesTags: (_, __, arg) => (arg.watchlist === 'string' ? ['myWatchList', 'tokenList'] : ['tokenList']),
providesTags: (_, __, { type }) =>
type === KyberAIListType.MYWATCHLIST ? ['myWatchList', 'tokenList'] : ['tokenList'],
}),
assetOverview: builder.query<IAssetOverview, { assetId?: string }>({
query: ({ assetId }: { assetId?: string }) => ({
Expand Down Expand Up @@ -263,7 +264,7 @@ const kyberAIApi = createApi({
patchResult.undo()
}
},
invalidatesTags: (result, error) => (error ? [] : ['watchlistsInfo']),
invalidatesTags: (result, error) => (error ? [] : ['watchlistsInfo', 'myWatchList']),
}),
//20.
removeFromWatchlist: builder.mutation({
Expand Down Expand Up @@ -292,7 +293,7 @@ const kyberAIApi = createApi({
patchResult.undo()
}
},
invalidatesTags: (result, error) => (error ? [] : ['watchlistsInfo']),
invalidatesTags: (result, error) => (error ? [] : ['watchlistsInfo', 'myWatchList']),
}),
//21.
createCustomWatchlist: builder.mutation({
Expand Down
4 changes: 2 additions & 2 deletions src/pages/TrueSightV2/pages/TokenAnalysisList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@ export default function TokenAnalysisList() {
<>
{above768 ? (
<tr>
<td colSpan={isCexFlowTabs ? 9 : 8} height={400} style={{ pointerEvents: 'none' }}>
<td colSpan={isCexFlowTabs ? 9 : 8} height={500} style={{ pointerEvents: 'none' }}>
<Text>
{listType === KyberAIListType.MYWATCHLIST && listData.length === 0 ? (
{listType === KyberAIListType.MYWATCHLIST && listData.length === 0 && page === 1 ? (
<Trans>You haven&apos;t added any tokens to your watchlist yet</Trans>
) : (
<Trans>There was an error. Please try again later.</Trans>
Expand Down

0 comments on commit e177d5c

Please sign in to comment.