Skip to content

Commit

Permalink
Merge pull request #181 from dappforce/fix/top-users
Browse files Browse the repository at this point in the history
Fix Minor Issues
  • Loading branch information
olehmell authored Jan 19, 2024
2 parents 2d1b0ca + 7f9f72a commit 99c93d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/creators/MobileActiveStakingSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function MobileActiveStakingSection({
margin: `${offsetY}px ${offsetX}px 0`,
position: 'sticky',
top: '64px',
zIndex: 10,
zIndex: 9,
background: 'white',
...props.style,
}}
Expand Down
22 changes: 11 additions & 11 deletions src/rtk/features/activeStaking/topUsersSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ const sliceName = 'topUsers'

export const selectTopUsers = (state: RootState) => state.topUsers

export async function fetchTopUsersWithSpaces(dispatch: AppDispatch, api: SubsocialApi) {
const { payload } = await dispatch(fetchTopUsers())
if (payload === null) return

const parsedPayload = payload as TopUsers
const creators = parsedPayload.creators.map(user => user.address)
const stakers = parsedPayload.stakers.map(user => user.address)

await dispatch(fetchProfileSpaces({ ids: [...creators, ...stakers], api }))
}

export const fetchTopUsers = createSimpleFetchWrapper<null, TopUsers | null>({
sliceName,
fetchData: async function () {
Expand All @@ -37,6 +26,17 @@ export const fetchTopUsers = createSimpleFetchWrapper<null, TopUsers | null>({
saveToCacheAction: data => slice.actions.setTopUsers(data),
})

export async function fetchTopUsersWithSpaces(dispatch: AppDispatch, api: SubsocialApi) {
const { payload } = await dispatch(fetchTopUsers())
if (!payload) return

const parsedPayload = payload as TopUsers
const creators = parsedPayload.creators.map(user => user.address)
const stakers = parsedPayload.stakers.map(user => user.address)

await dispatch(fetchProfileSpaces({ ids: [...creators, ...stakers], api }))
}

const initialState = null as TopUsers | null
const slice = createSlice({
name: sliceName,
Expand Down

0 comments on commit 99c93d3

Please sign in to comment.