update: use fluentApi to fetch images in resolvers

This commit is contained in:
MTG2000
2022-09-13 10:52:34 +03:00
parent 63286d878a
commit 60ecbefc97
7 changed files with 448 additions and 364 deletions

View File

@@ -14,13 +14,7 @@ import { fetchIsLoggedIn, fetchLnurlAuth } from "src/api/auth";
const fetchLnurlAuth = async () => {
const res = await fetch(CONSTS.apiEndpoint + '/get-login-url', {
credentials: 'include'
})
const data = await res.json()
return data;
}
export const useLnurlQuery = () => {
const [loading, setLoading] = useState(true)
@@ -101,15 +95,9 @@ export default function LoginPage() {
if (canFetchIsLogged.current === false) return;
canFetchIsLogged.current = false;
fetch(CONSTS.apiEndpoint + '/is-logged-in', {
credentials: 'include',
headers: {
session_token
}
})
.then(data => data.json())
.then(data => {
if (data.logged_in) {
fetchIsLoggedIn(session_token)
.then(is_logged_in => {
if (is_logged_in) {
clearInterval(interval)
refetch();
}