Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/modules/explorer/components/ProposalsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ interface Props {
proposalStyle?: any
showFullList?: boolean
filters: undefined | Filters
daoId?: string
}

interface ProposalObj {
Expand All @@ -53,7 +54,8 @@ export const ProposalsList: React.FC<Props> = ({
liteProposals,
proposalStyle,
showFullList = true,
filters = undefined
filters = undefined,
daoId
}) => {
const [currentPage, setCurrentPage] = useState(0)
const [offset, setOffset] = useState(0)
Expand Down Expand Up @@ -196,7 +198,7 @@ export const ProposalsList: React.FC<Props> = ({
</CustomGrid>
) : (
<div style={{ width: "inherit", marginBottom: 16 }} key={`poll-${i}`}>
<ProposalTableRow poll={p.proposal} />
<ProposalTableRow poll={p.proposal} daoId={daoId} />
</div>
)
)}
Expand Down
1 change: 1 addition & 0 deletions src/modules/explorer/pages/Proposals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const TezosProposals = () => {
proposals={undefined}
liteProposals={polls}
filters={filters}
daoId={daoId}
/>
)}
{!(polls && polls.length > 0) ? (
Expand Down
2 changes: 2 additions & 0 deletions src/modules/explorer/pages/User/components/UserMovements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export const UserMovements: React.FC<{
liteProposals={showActivity ? pollsPosted : pollsPosted?.slice(0, 2)}
showFullList={showActivity}
filters={filters}
daoId={daoId}
/>
)}
{!(proposalsCreated && proposalsCreated.length > 0) && !(pollsPosted && pollsPosted.length > 0) ? (
Expand All @@ -304,6 +305,7 @@ export const UserMovements: React.FC<{
liteProposals={showActivity ? votedPolls : votedPolls.slice(0, 2)}
showFullList={showActivity}
filters={filters}
daoId={daoId}
/>
)}
{!(proposalsVoted && proposalsVoted.length > 0) && !(votedPolls && votedPolls.length > 0) ? (
Expand Down
4 changes: 3 additions & 1 deletion src/modules/lite/explorer/pages/ProposalDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export const ProposalDetails: React.FC<{ id: string }> = ({ id }) => {
const [isLoading, setIsLoading] = useState(false)

const navigateToDao = () => {
if (historyLength > 1) {
if (state?.daoId) {
navigate.push(`/explorer/dao/${state.daoId}`)
} else if (historyLength > 1) {
navigate.goBack()
} else {
const daoUrl = pathname?.replace(`proposal/${proposalId}`, "")
Expand Down
7 changes: 6 additions & 1 deletion src/services/services/dao/hooks/useAllDAOs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ export const useAllDAOs = (network: Network) => {
lite_daos = []
}

return [...homebase_daos, ...lite_daos]
// Filter out lite DAOs that already have a corresponding full (on-chain) DAO,
// since the full DAO page already displays their off-chain polls.
const fullDaoAddresses = new Set(homebase_daos.map((dao: any) => dao.address))
const dedupedLiteDaos = lite_daos.filter((dao: any) => !dao.daoContract || !fullDaoAddresses.has(dao.daoContract))

return [...homebase_daos, ...dedupedLiteDaos]
},
{
// Always create the hook; let the fetcher short-circuit for Etherlink networks.
Expand Down
1 change: 1 addition & 0 deletions src/services/services/lite/lite-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const getLiteDAOs = async (network: string) => {
},
votingAddressesCount: dao.votingAddressesCount,
allowPublicAccess: dao.allowPublicAccess,
daoContract: dao.daoContract,
ledgers: dao.members.map(member => {
return {
holder: {
Expand Down
2 changes: 2 additions & 0 deletions src/services/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export interface DAOListItem {
token: TokenDTO
votingAddressesCount: number
allowPublicAccess: boolean
daoContract?: string
}

export type FetchedDAO = DAODTO & {
Expand Down Expand Up @@ -251,4 +252,5 @@ export interface Community {
decimals: string
network: Network
votingAddressesCount: number
daoContract?: string
}
Loading