diff --git a/packages/atlas/src/hooks/useIsTokenInLockedMode.ts b/packages/atlas/src/hooks/useIsTokenInLockedMode.ts index b4f8f52d80..a5f6a22f5f 100644 --- a/packages/atlas/src/hooks/useIsTokenInLockedMode.ts +++ b/packages/atlas/src/hooks/useIsTokenInLockedMode.ts @@ -1,15 +1,16 @@ -import { useRef } from 'react' - +// import { useRef } from 'react' import { FullCreatorTokenFragment } from '@/api/queries/__generated__/fragments.generated' -import { useJoystreamStore } from '@/providers/joystream/joystream.store' + +// import { useJoystreamStore } from '@/providers/joystream/joystream.store' export const useIsTokenInLockedMode = (token?: FullCreatorTokenFragment) => { - const currentBlockRef = useRef(useJoystreamStore((store) => store.currentBlock)) + // const currentBlockRef = useRef(useJoystreamStore((store) => store.currentBlock)) // 1. Check if there is any unfinalized revenue share const activeRevenueShare = token?.revenueShares.find((rS) => !rS.finalized) // 2. If ending block is not yet came for a user, consider that the token is locked - const hasActiveRevenueShare = (activeRevenueShare?.endsAt ?? 0) > currentBlockRef.current + // BUG: looks like runtime doesnt allow to make tx if the revenue share not finalized + // const hasActiveRevenueShare = (activeRevenueShare?.endsAt ?? 0) > currentBlockRef.current - return hasActiveRevenueShare + return !!activeRevenueShare }