Skip to content

Commit

Permalink
♻️ (results) Remove unecessary totalSelected compute
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 15, 2023
1 parent ac464ea commit 44d7740
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ export const SelectionToolbar = ({
const selectLabelColor = useColorModeValue('blue.500', 'blue.200')
const { typebot } = useTypebot()
const { showToast } = useToast()
const {
flatResults: results,
resultHeader,
totalResults,
tableData,
onDeleteResults,
} = useResults()
const { resultHeader, tableData, onDeleteResults } = useResults()
const { isOpen, onOpen, onClose } = useDisclosure()
const [isDeleteLoading, setIsDeleteLoading] = useState(false)
const [isExportLoading, setIsExportLoading] = useState(false)
Expand All @@ -57,10 +51,7 @@ export const SelectionToolbar = ({
const workspaceId = typebot?.workspaceId
const typebotId = typebot?.id

const totalSelected =
selectedResultsId.length > 0 && selectedResultsId.length === results?.length
? totalResults
: selectedResultsId.length
const totalSelected = selectedResultsId.length

const deleteResults = async () => {
if (!workspaceId || !typebotId) return
Expand Down

0 comments on commit 44d7740

Please sign in to comment.