Skip to content

Commit

Permalink
fix hasPinnedChannels
Browse files Browse the repository at this point in the history
  • Loading branch information
hellno committed Sep 12, 2024
1 parent 90ac6fb commit 7d84e00
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions pages/welcome/success.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import React, { useState, useEffect, useCallback } from 'react';
import {
CheckCircleIcon,
MagnifyingGlassIcon,
NewspaperIcon,
PencilSquareIcon,
PlusCircleIcon,
RectangleGroupIcon,
} from '@heroicons/react/20/solid';
import React, { useState, useEffect } from 'react';
import { CheckCircleIcon, MagnifyingGlassIcon, PencilSquareIcon, RectangleGroupIcon } from '@heroicons/react/20/solid';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
import { useRouter } from 'next/router';
import { useDraftStore } from '@/stores/useDraftStore';
import { JoinedHerocastPostDraft } from '@/common/constants/postDrafts';
import Link from 'next/link';
import findIndex from 'lodash.findindex';
import { Progress } from '@/components/ui/progress';
import { Checkbox } from '@/components/ui/checkbox';
import { DraftStatus } from '@/common/constants/farcaster';
Expand Down Expand Up @@ -79,7 +71,8 @@ const WelcomeSuccessPage = () => {
router.push('/post');
};

const hasPinnedChannels = useAccountStore((state) => state.accounts.some((account) => account.channels.length > 0));
const accounts = useAccountStore((state) => state.accounts);
const hasPinnedChannels = accounts && accounts.some((account) => account?.channels.length > 0);
const hasScheduledCasts =
drafts.filter((draft) => draft.status === DraftStatus.scheduled || draft.status === DraftStatus.published).length >
0;
Expand Down

0 comments on commit 7d84e00

Please sign in to comment.