Skip to content

Commit

Permalink
Fix bug for new channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Droniu committed Sep 22, 2023
1 parent dd1e372 commit 1fb4927
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-strict-ignore
import ChannelsAvailabilityDialog from "@dashboard/components/ChannelsAvailabilityDialog";
import { ChannelFragment } from "@dashboard/graphql";
import useStateFromProps from "@dashboard/hooks/useStateFromProps";
Expand Down Expand Up @@ -26,13 +25,13 @@ const ProductChannelsListingsDialog: React.FC<
const intl = useIntl();

const [selected, setSelected] = useStateFromProps(
data.channels.updateChannels?.map(listing => listing.channelId),
data.channels.updateChannels?.map(listing => listing.channelId) ?? [],
);

const handleConfirm = () => {
onConfirm(
arrayDiff(
data.channels.updateChannels.map(({ channelId }) => channelId),
data.channels.updateChannels?.map(({ channelId }) => channelId) ?? [],
selected,
),
);
Expand Down

0 comments on commit 1fb4927

Please sign in to comment.