♻️ (results) Remove unecessary totalSelected compute
This commit is contained in:
@ -28,13 +28,7 @@ export const SelectionToolbar = ({
|
|||||||
const selectLabelColor = useColorModeValue('blue.500', 'blue.200')
|
const selectLabelColor = useColorModeValue('blue.500', 'blue.200')
|
||||||
const { typebot } = useTypebot()
|
const { typebot } = useTypebot()
|
||||||
const { showToast } = useToast()
|
const { showToast } = useToast()
|
||||||
const {
|
const { resultHeader, tableData, onDeleteResults } = useResults()
|
||||||
flatResults: results,
|
|
||||||
resultHeader,
|
|
||||||
totalResults,
|
|
||||||
tableData,
|
|
||||||
onDeleteResults,
|
|
||||||
} = useResults()
|
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure()
|
const { isOpen, onOpen, onClose } = useDisclosure()
|
||||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false)
|
const [isDeleteLoading, setIsDeleteLoading] = useState(false)
|
||||||
const [isExportLoading, setIsExportLoading] = useState(false)
|
const [isExportLoading, setIsExportLoading] = useState(false)
|
||||||
@ -57,10 +51,7 @@ export const SelectionToolbar = ({
|
|||||||
const workspaceId = typebot?.workspaceId
|
const workspaceId = typebot?.workspaceId
|
||||||
const typebotId = typebot?.id
|
const typebotId = typebot?.id
|
||||||
|
|
||||||
const totalSelected =
|
const totalSelected = selectedResultsId.length
|
||||||
selectedResultsId.length > 0 && selectedResultsId.length === results?.length
|
|
||||||
? totalResults
|
|
||||||
: selectedResultsId.length
|
|
||||||
|
|
||||||
const deleteResults = async () => {
|
const deleteResults = async () => {
|
||||||
if (!workspaceId || !typebotId) return
|
if (!workspaceId || !typebotId) return
|
||||||
|
Reference in New Issue
Block a user