Always show follow a community prompt
This commit is contained in:
parent
ab6cfd2564
commit
faa49b750e
|
@ -62,9 +62,9 @@ const Home = (props: {
|
|||
contracts.map((contract, index) => [contract.id, index])
|
||||
)
|
||||
|
||||
const followedFoldIds = useFollowedFolds(user) ?? []
|
||||
const followedFoldIds = useFollowedFolds(user)
|
||||
const followedFolds = filterDefined(
|
||||
followedFoldIds.map((id) => folds.find((fold) => fold.id === id))
|
||||
(followedFoldIds ?? []).map((id) => folds.find((fold) => fold.id === id))
|
||||
)
|
||||
const tagSet = new Set(
|
||||
_.flatten(followedFolds.map((fold) => fold.lowercaseTags))
|
||||
|
@ -75,15 +75,17 @@ const Home = (props: {
|
|||
? new Set(yourBetContractIds)
|
||||
: undefined
|
||||
|
||||
// By default, show all contracts
|
||||
let feedContracts = contracts
|
||||
// If the user is following any folds, then exclude all other contracts
|
||||
if (yourBetContracts && followedFoldIds.length > 0) {
|
||||
feedContracts = contracts.filter(
|
||||
(contract) =>
|
||||
contract.lowercaseTags.some((tag) => tagSet.has(tag)) ||
|
||||
yourBetContracts.has(contract.id)
|
||||
)
|
||||
// Show no contracts before your info is loaded.
|
||||
let feedContracts: Contract[] = []
|
||||
if (yourBetContracts && followedFoldIds) {
|
||||
// Show all contracts if no folds are followed.
|
||||
if (followedFoldIds.length === 0) feedContracts = contracts
|
||||
else
|
||||
feedContracts = contracts.filter(
|
||||
(contract) =>
|
||||
contract.lowercaseTags.some((tag) => tagSet.has(tag)) ||
|
||||
yourBetContracts.has(contract.id)
|
||||
)
|
||||
}
|
||||
|
||||
const oneDayMS = 24 * 60 * 60 * 1000
|
||||
|
@ -145,17 +147,13 @@ const Home = (props: {
|
|||
<Row className="text-sm text-gray-800 mx-3 mb-3 gap-2 items-center">
|
||||
<SparklesIcon className="inline w-5 h-5" aria-hidden="true" />
|
||||
Recent activity
|
||||
{followedFoldIds.length === 0 ? (
|
||||
<>
|
||||
<span>—</span>
|
||||
<span>
|
||||
<SiteLink href="/folds" className="font-semibold">
|
||||
follow a community
|
||||
</SiteLink>{' '}
|
||||
to personalize
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
<span>—</span>
|
||||
<span>
|
||||
<SiteLink href="/folds" className="font-semibold">
|
||||
follow a community
|
||||
</SiteLink>{' '}
|
||||
to personalize
|
||||
</span>
|
||||
</Row>
|
||||
|
||||
{activeContracts ? (
|
||||
|
|
Loading…
Reference in New Issue
Block a user