Skip to content

Commit

Permalink
chore: remove auto refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Feb 28, 2024
1 parent 84069db commit 09f0779
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions apps/web/src/components/Staff/Users/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@ import {
useExploreProfilesQuery
} from '@hey/lens';
import getProfile from '@hey/lib/getProfile';
import {
Button,
Card,
EmptyState,
ErrorMessage,
Modal,
Select,
Toggle,
Tooltip
} from '@hey/ui';
import { Button, Card, EmptyState, ErrorMessage, Modal, Select } from '@hey/ui';
import cn from '@hey/ui/cn';
import { motion } from 'framer-motion';
import Link from 'next/link';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { useState } from 'react';
import { Virtuoso } from 'react-virtuoso';

import ProfileFeed from './ProfileFeed';
Expand All @@ -37,7 +28,6 @@ const List: FC = () => {
ExploreProfilesOrderByType.LatestCreated
);
const [value, setValue] = useState('');
const [autoRefresh, setAutoRefresh] = useState(false);
const [refetching, setRefetching] = useState(false);
const [showPublicationsModal, setShowPublicationsModal] = useState(false);
const [selectedProfile, setSelectedProfile] = useState<null | Profile>(null);
Expand All @@ -53,17 +43,6 @@ const List: FC = () => {
variables: { request }
});

useEffect(() => {
if (autoRefresh) {
const interval = setInterval(() => {
refetch();
}, 1000);

return () => clearInterval(interval);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [autoRefresh]);

const profiles = data?.exploreProfiles.items;
const pageInfo = data?.exploreProfiles?.pageInfo;
const hasMore = pageInfo?.next;
Expand Down Expand Up @@ -118,9 +97,6 @@ const List: FC = () => {
className={cn(refetching && 'animate-spin', 'size-5')}
/>
</button>
<Tooltip content="Auto refresh" placement="top">
<Toggle on={autoRefresh} setOn={() => setAutoRefresh(!autoRefresh)} />
</Tooltip>
</div>
<div className="divider" />
<div className="p-5">
Expand Down

1 comment on commit 09f0779

@vercel
Copy link

@vercel vercel bot commented on 09f0779 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

heyxyz.vercel.app
web-heyxyz.vercel.app
hey.xyz
web-git-main-heyxyz.vercel.app

Please sign in to comment.