diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 3008cf22..4318fc93 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -160,6 +160,7 @@ export default { 'Select relays to append': 'Select relays to append', 'calculating...': 'calculating...', 'Calculate optimal read relays': 'Calculate optimal read relays', - 'Login to set': 'Login to set' + 'Login to set': 'Login to set', + 'Please login to view following feed': 'Please login to view following feed' } } diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index 92793fc8..9838102e 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -161,6 +161,7 @@ export default { 'Select relays to append': '选择要追加的服务器', 'calculating...': '计算中...', 'Calculate optimal read relays': '计算最佳读服务器', - 'Login to set': '登录后设置' + 'Login to set': '登录后设置', + 'Please login to view following feed': '请登录以查看关注动态' } } diff --git a/src/pages/primary/NoteListPage/index.tsx b/src/pages/primary/NoteListPage/index.tsx index a92407ff..33e977d2 100644 --- a/src/pages/primary/NoteListPage/index.tsx +++ b/src/pages/primary/NoteListPage/index.tsx @@ -1,7 +1,9 @@ import NoteList from '@/components/NoteList' import SaveRelayDropdownMenu from '@/components/SaveRelayDropdownMenu' +import { Button } from '@/components/ui/button' import PrimaryPageLayout from '@/layouts/PrimaryPageLayout' import { useFeed } from '@/providers/FeedProvider' +import { useNostr } from '@/providers/NostrProvider' import { useEffect, useRef } from 'react' import { useTranslation } from 'react-i18next' import FeedButton from './FeedButton' @@ -10,6 +12,7 @@ import SearchButton from './SearchButton' export default function NoteListPage() { const { t } = useTranslation() const layoutRef = useRef<{ scrollToTop: () => void }>(null) + const { pubkey, checkLogin } = useNostr() const { feedType, relayUrls, isReady, filter } = useFeed() useEffect(() => { @@ -18,6 +21,19 @@ export default function NoteListPage() { } }, [JSON.stringify(relayUrls), feedType]) + let content =
{t('loading...')}
+ if (feedType === 'following' && !pubkey) { + content = ( +
+ +
+ ) + } else if (isReady) { + content = + } + return ( - {isReady ? ( - - ) : ( -
{t('loading...')}
- )} + {content}
) }