Skip to content

Commit

Permalink
fix: routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Songkeys committed Sep 16, 2022
1 parent 19681b6 commit 107ee54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pages/feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function FeedTabs() {
const tabs = [
{ label: "Home", route: "/feed" },
{ label: "Explore", route: "/explore" },
{ label: "Latest", route: "/feed/latest" },
{ label: "Latest", route: "/latest" },
];

const { validate } = useLoginChecker();
Expand All @@ -49,7 +49,7 @@ export function FeedTabs() {
const { hasCharacter, isLoadingCharacter } = useHasCharacter();
const router = useRouter();
useEffect(() => {
if (!isLoadingCharacter && !hasCharacter) {
if (router.asPath === "/feed" && !isLoadingCharacter && !hasCharacter) {
router.replace("/explore");
}
}, [isLoadingCharacter, hasCharacter]);
Expand Down
6 changes: 3 additions & 3 deletions pages/feed/latest.tsx → pages/latest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ function NoteList() {
{/* feeds */}
{data?.pages.map((page, i) => (
<Fragment key={i}>
{page.list.map((feed, i) => (
{page.list.map((note, i) => (
<Note
note={feed}
key={`${feed.transactionHash}-${feed.logIndex}`}
note={note}
key={`${note.characterId}-${note.noteId}`}
collapsible
/>
))}
Expand Down
1 change: 1 addition & 0 deletions utils/apis/indexer/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const TIMELINE_FEED_TYPES: FeedType[] = [
"LINK",
"POST_NOTE",
"POST_NOTE_FOR_ANY_URI",
"POST_NOTE_FOR_NOTE",
// "TRANSFER_CHARACTER",
// "TRANSFER_MINTED_NOTE",
// "UPDATE_CHARACTER_HANDLE",
Expand Down

0 comments on commit 107ee54

Please sign in to comment.