refactor: use Convex skip sentinel in query args
This commit is contained in:
parent
3de7eccaa8
commit
bd2f22d046
32 changed files with 167 additions and 157 deletions
|
|
@ -74,10 +74,12 @@ function TicketRow({ ticket, entering }: { ticket: Ticket; entering: boolean })
|
|||
|
||||
export function RecentTicketsPanel() {
|
||||
const { convexUserId } = useAuth()
|
||||
const ticketsArgs = convexUserId
|
||||
? { tenantId: DEFAULT_TENANT_ID, viewerId: convexUserId as Id<"users">, limit: 12 }
|
||||
: undefined
|
||||
const ticketsResult = useQuery(convexUserId ? api.tickets.list : undefined, ticketsArgs)
|
||||
const ticketsResult = useQuery(
|
||||
api.tickets.list,
|
||||
convexUserId
|
||||
? { tenantId: DEFAULT_TENANT_ID, viewerId: convexUserId as Id<"users">, limit: 12 }
|
||||
: "skip"
|
||||
)
|
||||
const [enteringId, setEnteringId] = useState<string | null>(null)
|
||||
const previousIdsRef = useRef<string[]>([])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue