| Auth on view content
This commit is contained in:
parent
a9111959cd
commit
71284b722c
|
|
@ -28,25 +28,35 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// const first = setTimeout(async () => {
|
||||||
|
// console.log("💩💩💩 call auth");
|
||||||
|
// await auth.mutateAsync();
|
||||||
|
// }, 1000);
|
||||||
|
//
|
||||||
|
// const second = setTimeout(() => {
|
||||||
|
// setLoaded(true);
|
||||||
|
//
|
||||||
|
// if (tonConnectUI.connected) {
|
||||||
|
// nextStep();
|
||||||
|
// }
|
||||||
|
// }, 4000);
|
||||||
|
//
|
||||||
|
// return () => {
|
||||||
|
// clearTimeout(first);
|
||||||
|
// clearTimeout(second);
|
||||||
|
// };
|
||||||
|
// }, [tonConnectUI.connected]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const first = setTimeout(async () => {
|
const timeout = setTimeout(() => {
|
||||||
console.log("💩💩💩 call auth");
|
setLoaded(true)
|
||||||
await auth.mutateAsync();
|
}, 5000);
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
const second = setTimeout(() => {
|
|
||||||
setLoaded(true);
|
|
||||||
|
|
||||||
if (tonConnectUI.connected) {
|
|
||||||
nextStep();
|
|
||||||
}
|
|
||||||
}, 4000);
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
clearTimeout(first);
|
clearTimeout(timeout);
|
||||||
clearTimeout(second);
|
}
|
||||||
};
|
}, []);
|
||||||
}, [tonConnectUI.connected]);
|
|
||||||
|
|
||||||
if (!isLoaded) {
|
if (!isLoaded) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,11 @@ export const useCreateNewContent = () => {
|
||||||
address: string;
|
address: string;
|
||||||
amount: string;
|
amount: string;
|
||||||
payload: string;
|
payload: string;
|
||||||
}>("/blockchain.sendNewContentMessage", payload);
|
}>("/blockchain.sendNewContentMessage", payload, {
|
||||||
|
headers: {
|
||||||
|
Authorization: localStorage.getItem('auth_v1_token') ?? ""
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
@ -41,7 +45,11 @@ export const useCreateNewContent = () => {
|
||||||
|
|
||||||
export const useViewContent = (contentId: string) => {
|
export const useViewContent = (contentId: string) => {
|
||||||
return useQuery(["view", "content", contentId], () => {
|
return useQuery(["view", "content", contentId], () => {
|
||||||
return request.get(`/content.view/${contentId}`);
|
return request.get(`/content.view/${contentId}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: localStorage.getItem('auth_v1_token') ?? ""
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -62,6 +70,10 @@ export const usePurchaseContent = () => {
|
||||||
}>("/blockchain.sendPurchaseContentMessage", {
|
}>("/blockchain.sendPurchaseContentMessage", {
|
||||||
content_address,
|
content_address,
|
||||||
license_type,
|
license_type,
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
Authorization: localStorage.getItem('auth_v1_token') ?? ""
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ export const useUploadFile = () => {
|
||||||
}>("/storage", formData, {
|
}>("/storage", formData, {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "multipart/form-data",
|
"Content-Type": "multipart/form-data",
|
||||||
|
Authorization: localStorage.getItem('auth_v1_token') ?? ""
|
||||||
},
|
},
|
||||||
|
|
||||||
onUploadProgress: (progressEvent) => {
|
onUploadProgress: (progressEvent) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue