frontend client for gemstone. decentralised workplace app

refactor: use compare function helper

serenity 00f26152 b45c2a41

Changed files
+8 -2
src
providers
+8 -2
src/providers/authed/ChannelsProvider.tsx
···
systemsGmstnDevelopmentChannelRecordSchema,
type SystemsGmstnDevelopmentChannel,
} from "@/lib/types/lexicon/systems.gmstn.development.channels";
-
import { getRecordFromFullAtUri, stringToAtUri } from "@/lib/utils/atproto";
+
import {
+
atUriEquals,
+
getRecordFromFullAtUri,
+
stringToAtUri,
+
} from "@/lib/utils/atproto";
import { useMemberships } from "@/providers/authed/MembershipsProvider";
import { useQueries } from "@tanstack/react-query";
import type { ReactNode } from "react";
···
export const useChannelRecordByAtUriObject = (channelAtUri: AtUri) => {
const { channels } = useChannelRecords();
-
return channels.find((channel) => channel.channelAtUri === channelAtUri);
+
return channels.find((channel) =>
+
atUriEquals(channel.channelAtUri, channelAtUri),
+
);
};
export const useChannelRecordByAtUriString = (channelAtUriString: string) => {