| Auth on view content
This commit is contained in:
1 parent
ed33936e4f
commit
39fef5cb2a
1 file changed
+4
-2
@@ -20,13 +20,15 @@ export const ViewContentPage = () => {
|
||||
|
||||
const auth = useAuth();
|
||||
|
||||
useEffect(() => {
|
||||
void auth.mutateAsync()
|
||||
}, []);
|
||||
|
||||
const handleBuyContent = useCallback(async () => {
|
||||
try {
|
||||
if (!tonConnectUI.connected) {
|
||||
await tonConnectUI.openModal();
|
||||
await auth.mutateAsync();
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -57,7 +59,7 @@ export const ViewContentPage = () => {
|
||||
} catch (error) {
|
||||
console.error("Error handling Ton Connect subscription:", error);
|
||||
}
|
||||
}, [content]);
|
||||
}, [content, tonConnectUI.connected]);
|
||||
|
||||
const haveLicense = useMemo(() => {
|
||||
return content?.data?.have_licenses?.includes("listen") || content?.data?.have_licenses?.includes("resale")
|
||||
|
||||
Reference in new issue
Block a user