From c88d540b881aab439dadf76e7b88206e07c67212 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Mon, 24 Apr 2023 19:57:40 +0700 Subject: [PATCH] temp fix channel list --- src/components/channels/channelList.tsx | 12 ++++++++++-- src/components/navigation.tsx | 5 ++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/channels/channelList.tsx b/src/components/channels/channelList.tsx index f7d97906..5c2c4c36 100644 --- a/src/components/channels/channelList.tsx +++ b/src/components/channels/channelList.tsx @@ -1,12 +1,20 @@ import { ChannelListItem } from '@components/channels/channelListItem'; import { CreateChannelModal } from '@components/channels/createChannelModal'; -import { channelsAtom } from '@stores/channel'; +import { channelsAtom, defaultChannelsAtom } from '@stores/channel'; import { useAtomValue } from 'jotai'; export default function ChannelList() { - const list = useAtomValue(channelsAtom); + let atom; + + if (typeof window !== 'undefined') { + atom = channelsAtom; + } else { + atom = defaultChannelsAtom; + } + + const list: any = useAtomValue(atom); return (