Skip to content

Commit

Permalink
don't throw on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Jun 20, 2023
1 parent 13a2382 commit 9b96148
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/hooks/useClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ export function useClient() {
export function useSetClient() {
const setClient = useContext(ClientContext).setClient;

return (client: Client) => {
client.registerCodec(new AttachmentCodec());
client.registerCodec(new RemoteAttachmentCodec());
client.enableGroupChat();
return (client: Client | null) => {
if (client) {
client.registerCodec(new AttachmentCodec());
client.registerCodec(new RemoteAttachmentCodec());
client.enableGroupChat();
}

setClient(client);
};
Expand Down

0 comments on commit 9b96148

Please sign in to comment.