Skip to content

Commit

Permalink
actually make it fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Robonau authored and Robonau committed Nov 9, 2024
1 parent 9463ae9 commit ed6e17a
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 113 deletions.
18 changes: 10 additions & 8 deletions src/routes/(app)/(library)/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ export const load: PageLoad = ({ fetch, url }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getCategories,
{},
{
fetch
}
);
mod.client
.query(
getCategories,
{},
{
fetch
}
)
.toPromise();
const tab = parseInt(url.searchParams.get('tab') ?? '0');
mod.client.query(getCategory, { id: tab }, { fetch });
mod.client.query(getCategory, { id: tab }, { fetch }).toPromise();
})();
};
16 changes: 9 additions & 7 deletions src/routes/(app)/browse/extensions/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ export const load: PageLoad = ({ fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getExtensions,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
);
mod.client
.query(
getExtensions,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
)
.toPromise();
})();
};
16 changes: 9 additions & 7 deletions src/routes/(app)/browse/globalsearch/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ export const load: PageLoad = ({ fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getSources,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
);
mod.client
.query(
getSources,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
)
.toPromise();
})();
};
16 changes: 9 additions & 7 deletions src/routes/(app)/browse/migrate/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ export const load: PageLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
sourcesMigration,
{},
{
fetch
}
);
mod.client
.query(
sourcesMigration,
{},
{
fetch
}
)
.toPromise();
})();
return params;
};
32 changes: 18 additions & 14 deletions src/routes/(app)/browse/migrate/manga/[MangaID]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ export const load: PageLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getManga,
{ id: MangaID },
{
fetch
}
);
mod.client.query(
getSources,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
);
mod.client
.query(
getManga,
{ id: MangaID },
{
fetch
}
)
.toPromise();
mod.client
.query(
getSources,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
)
.toPromise();
})();
return {
MangaID
Expand Down
32 changes: 18 additions & 14 deletions src/routes/(app)/browse/migrate/source/[SourceID]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,24 @@ export const load: PageLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
sourceMigrationManga,
{ sourceId: params.SourceID },
{
fetch
}
);
mod.client.query(
sourceMigrationSource,
{ sourceId: params.SourceID },
{
fetch
}
);
mod.client
.query(
sourceMigrationManga,
{ sourceId: params.SourceID },
{
fetch
}
)
.toPromise();
mod.client
.query(
sourceMigrationSource,
{ sourceId: params.SourceID },
{
fetch
}
)
.toPromise();
})();
return params;
};
16 changes: 9 additions & 7 deletions src/routes/(app)/browse/source/[sourceID]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ export const load: LayoutLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getSource,
{ id: params.sourceID },
{
fetch
}
);
mod.client
.query(
getSource,
{ id: params.sourceID },
{
fetch
}
)
.toPromise();
})();
return { ...params };
};
16 changes: 9 additions & 7 deletions src/routes/(app)/browse/sources/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ export const load: PageLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getSources,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
);
mod.client
.query(
getSources,
{ isNsfw: gmState.value.nsfw ? null : false },
{
fetch
}
)
.toPromise();
})();
return { ...params };
};
16 changes: 9 additions & 7 deletions src/routes/(app)/history/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ export const load: PageLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
History,
{ offset: 0 },
{
fetch
}
);
mod.client
.query(
History,
{ offset: 0 },
{
fetch
}
)
.toPromise();
})();
return { ...params };
};
16 changes: 9 additions & 7 deletions src/routes/(app)/manga/[MangaID]/(manga)/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ export const load: PageLoad = ({ params, fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getManga,
{ id: MangaID },
{
fetch
}
);
mod.client
.query(
getManga,
{ id: MangaID },
{
fetch
}
)
.toPromise();
})();
return {
MangaID
Expand Down
16 changes: 9 additions & 7 deletions src/routes/(app)/settings/about/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export const load: PageLoad = ({ fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getabout,
{},
{
fetch
}
);
mod.client
.query(
getabout,
{},
{
fetch
}
)
.toPromise();
})();
};
16 changes: 9 additions & 7 deletions src/routes/(app)/settings/categories/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export const load: PageLoad = ({ fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
getCategories,
{},
{
fetch
}
);
mod.client
.query(
getCategories,
{},
{
fetch
}
)
.toPromise();
})();
};
16 changes: 9 additions & 7 deletions src/routes/(app)/settings/server/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export const load: PageLoad = ({ fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
serverSettings,
{},
{
fetch
}
);
mod.client
.query(
serverSettings,
{},
{
fetch
}
)
.toPromise();
})();
};
16 changes: 9 additions & 7 deletions src/routes/(app)/updates/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export const load: PageLoad = ({ fetch }) => {
if (browser)
(async () => {
const mod = await import('$lib/gql/graphqlClient');
mod.client.query(
updates,
{ offset: 0 },
{
fetch
}
);
mod.client
.query(
updates,
{ offset: 0 },
{
fetch
}
)
.toPromise();
})();
};

0 comments on commit ed6e17a

Please sign in to comment.