frontend client for gemstone. decentralised workplace app

feat: guaranteed value hook

serenity e39b2f40 4a374c93

Changed files
+9
src
providers
+9
src/providers/OAuthProvider.tsx
···
return agent;
};
+
export const useOAuthAgentGuaranteed = () => {
+
const { agent } = useOAuthValue();
+
if (!agent)
+
throw new Error(
+
"Tried to access OAuth agent before it was created. Ensure that you are calling useOAuthAgentGuaranteed *after* you have a valid OAuth session.",
+
);
+
return agent;
+
};
+
export const useOAuthClient = () => {
const { client } = useOAuthValue();
return client;