diff --git a/Dockerfile.data-backend.railway b/Dockerfile.data-backend.railway index dc646f5ad..ce9c88f5f 100644 --- a/Dockerfile.data-backend.railway +++ b/Dockerfile.data-backend.railway @@ -125,8 +125,8 @@ RUN pnpm --filter indexer-prisma build # Build the data-backend package # Build indexer-prisma and owned prisma # RUN pnpm --filter data-backend build:all_repo -# Build data-backend # RUN pnpm --filter data-backend build:all +RUN pnpm --filter data-backend build:prisma RUN pnpm --filter data-backend build # Use a smaller production base image diff --git a/apps/data-backend/package.json b/apps/data-backend/package.json index 6366946b1..2adbb529b 100644 --- a/apps/data-backend/package.json +++ b/apps/data-backend/package.json @@ -8,6 +8,7 @@ "build:index": "tsc", "build:all_repo": "pnpm -w run build:indexer-prisma && pnpm run prisma:setup && tsc", "build:all": "pnpm run prisma:setup && tsc", + "build:prisma": "pnpm run prisma:setup", "start": "ts-node src/index.ts", "start:dev": "ts-node-dev src/index.ts", "start:prod": "ts-node dist/index.js", diff --git a/apps/mobile/src/screens/Feed/index.tsx b/apps/mobile/src/screens/Feed/index.tsx index 8aff34f92..bec208eb6 100644 --- a/apps/mobile/src/screens/Feed/index.tsx +++ b/apps/mobile/src/screens/Feed/index.tsx @@ -1,26 +1,26 @@ -import {NDKKind} from '@nostr-dev-kit/ndk'; -import {useAllProfiles, useSearch} from 'afk_nostr_sdk'; -import {useAuth, useContacts} from 'afk_nostr_sdk'; -import {useCallback, useEffect, useState} from 'react'; -import {ActivityIndicator, FlatList, Image, Pressable, RefreshControl, View, Text} from 'react-native'; - -import {AddPostIcon} from '../../assets/icons'; -import {BubbleUser} from '../../components/BubbleUser'; +import { NDKKind } from '@nostr-dev-kit/ndk'; +import { useAllProfiles, useSearch } from 'afk_nostr_sdk'; +import { useAuth, useContacts } from 'afk_nostr_sdk'; +import { useCallback, useEffect, useState } from 'react'; +import { ActivityIndicator, FlatList, Image, Pressable, RefreshControl, View, Text } from 'react-native'; + +import { AddPostIcon } from '../../assets/icons'; +import { BubbleUser } from '../../components/BubbleUser'; import SearchComponent from '../../components/search'; -import {useStyles, useTheme} from '../../hooks'; -import {ChannelComponent} from '../../modules/ChannelCard'; -import {PostCard} from '../../modules/PostCard'; -import {VideoPostCard} from '../../modules/VideoPostCard'; -import {FeedScreenProps} from '../../types'; +import { useStyles, useTheme } from '../../hooks'; +import { ChannelComponent } from '../../modules/ChannelCard'; +import { PostCard } from '../../modules/PostCard'; +import { VideoPostCard } from '../../modules/VideoPostCard'; +import { FeedScreenProps } from '../../types'; import stylesheet from './styles'; -import {RenderEventCard} from '../../modules/Studio'; +import { RenderEventCard } from '../../modules/Studio'; import { useNotesFilter } from 'afk_nostr_sdk/src/hooks'; -export const Feed: React.FC = ({navigation}) => { - const {theme} = useTheme(); - const {publicKey} = useAuth(); +export const Feed: React.FC = ({ navigation }) => { + const { theme } = useTheme(); + const { publicKey } = useAuth(); const styles = useStyles(stylesheet); - const profiles = useAllProfiles({limit: 10}); + const profiles = useAllProfiles({ limit: 10 }); const [activeSortBy, setSortBy] = useState(); const [search, setSearch] = useState(undefined); const [feedData, setFeedData] = useState(null); @@ -35,17 +35,17 @@ export const Feed: React.FC = ({navigation}) => { // 30311 as NDKKind, ]); - const contacts = useContacts({authors: [publicKey]}); + const contacts = useContacts({ authors: [publicKey] }); const notes = useSearch({ kinds, - limit: 10, - // authors:[] + // limit: 20, + // authors: [] }); // const notes = useNotesFilter({ // kinds, // limit: 20, // }); - // console.log("notes", notes); + console.log("notes", notes); // Filter profiles based on the search query const profilesSearch = @@ -53,10 +53,12 @@ export const Feed: React.FC = ({navigation}) => { // .filter((item) => (search && search?.length > 0 ? item?.content?.includes(search) : true)) ?? []; const filteredNotes = useCallback(() => { - if (!notes.data?.pages) return []; - const flattenedPages = notes.data.pages.flat(); - console.log("flattenedPages",flattenedPages) + + // if (!notes.data?.pages || flattenedPages?.length == 0) return []; + if (!notes.data?.pages || flattenedPages?.length == 0) return []; + + console.log("flattenedPages", flattenedPages) console.log(flattenedPages, 'note pages'); if (!search || search.length === 0) { @@ -113,25 +115,24 @@ export const Feed: React.FC = ({navigation}) => { setKinds={setKinds} setSortBy={setSortBy} sortBy={activeSortBy} - // contactList={contacts?.data?.map((item) => item)} + // contactList={contacts?.data?.map((item) => item)} /> {/* {notes?.isLoading && } */} {notes?.isFetching && } - {!notes?.isLoading && !notes?.isFetching && notes?.data?.pages?.length == 0 && - - No notes found - Try to refresh the page or contact the support please! - {/*