frontend client for gemstone. decentralised workplace app

fix: don't load inner app until we are ready

serenity 41b12954 7ee4af66

Changed files
+15 -2
src
app
(protected)
[spaceId]
channel
[channelId]
+15 -2
src/app/(protected)/[spaceId]/channel/[channelId]/index.tsx
···
import { Chat } from "@/components/Chat";
+
import { Loading } from "@/components/primitives/Loading";
import { Text } from "@/components/primitives/Text";
import type { AtUri, DidPlc, DidWeb } from "@/lib/types/atproto";
import { useChannelRecordByAtUriObject } from "@/providers/authed/ChannelsProvider";
+
import { useSessions } from "@/providers/authed/SessionsProvider";
import { usePathname } from "expo-router";
import { View } from "react-native";
···
const authority = segments[1] as DidPlc | DidWeb;
const collection = "systems.gmstn.development.channel";
const rKey = segments[3];
+
const { isInitialising } = useSessions();
+
+
const isAppReady = !isInitialising;
const atUri: Required<AtUri> = {
authority,
···
const channelRecord = useChannelRecordByAtUriObject(atUri);
-
return channelRecord ? (
-
<View>
+
return !isAppReady ? (
+
<Loading />
+
) : channelRecord ? (
+
<View
+
style={{
+
flex: 1,
+
justifyContent: "center",
+
alignItems: "stretch",
+
}}
+
>
<Chat channelAtUri={channelRecord.channelAtUri} />
</View>
) : (