Skip to content

Commit

Permalink
Merge pull request #368 from calabara-hq/mb-filter
Browse files Browse the repository at this point in the history
fix trending list #patch
  • Loading branch information
ndodson authored Nov 18, 2024
2 parents c0a06d0 + b606d2b commit 97fbfe1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions uplink-client/src/app/explore/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ColorCards } from "@/ui/DesignKit/ColorCards";
import { Card, CardContent, CardFooter } from "@/ui/DesignKit/Card";
import { CardHeader, CardTitle } from "@/ui/DesignKit/Card";
import { fetchTrendingChannels, fetchActiveContests } from "@/lib/fetch/fetchChannel";
import { Channel, concatContractID } from "@/types/channel";
import { Channel, concatContractID, isInfiniteChannel } from "@/types/channel";
import { parseIpfsUrl } from "@/lib/ipfs";
import { Space } from "@/types/space";
import { fetchFeaturedTokens } from "@/lib/fetch/fetchTokensV2";
Expand Down Expand Up @@ -38,7 +38,8 @@ export const metadata: Metadata = {
};

const TrendingChannels = async () => {
let trendingChannels = await fetchTrendingChannels(8453)
let trendingChannels = await fetchTrendingChannels(8453).then(data => data.filter(isInfiniteChannel))
console.log(trendingChannels)

if (trendingChannels.length > 0)
return (
Expand Down
8 changes: 6 additions & 2 deletions uplink-hub/packages/v2/src/controllers/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { parseV2Metadata, splitContractID } from "../utils/utils.js";
import { Request, Response, NextFunction } from 'express'
import { ContexedRequest } from "../types.js";
import { gql } from '@urql/core'
import { formatGqlTokens, TOKEN_FRAGMENT } from "@tx-kit/sdk/subgraph";
import { CHANNEL_FRAGMENT, formatGqlTokens, TOKEN_FRAGMENT } from "@tx-kit/sdk/subgraph";

const authorizationController = new AuthorizationController(process.env.REDIS_URL!);

Expand Down Expand Up @@ -141,12 +141,16 @@ export const getTrendingChannels = async (req: Request, res: Response, next: Nex
where: {tokens_: {blockTimestamp_gt: $timestamp}, id_not_in: ["0xa4bc695f857239a0f26c289fee4c936689a0ddad", "0x00c58936afb2b89d6dd8b918c5a44aa1b0a4fdf8"]}
limit: 10
) {
id
...ChannelFragment
transportLayer {
type
}
tokens(first: 10) {
...TokenFragment
}
}
${TOKEN_FRAGMENT}
${CHANNEL_FRAGMENT}
}`,
{ timestamp: Math.floor(Date.now() / 1000) - 60 * 60 * 24 * 7 }) // 1 week

Expand Down

0 comments on commit 97fbfe1

Please sign in to comment.