Skip to content

Commit

Permalink
Merge pull request #164 from Suwayomi/main
Browse files Browse the repository at this point in the history
fix tracking authentication
  • Loading branch information
Robonau authored Mar 1, 2024
2 parents 5c7def2 + 9479817 commit b843919
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node_modules
.env.*
!.env.example

/src/lib/generated.ts
/src/graphql-env.d.ts

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node_modules
.env.*
!.env.example

/src/lib/generated.ts
/src/graphql-env.d.ts

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
Expand Down
8 changes: 4 additions & 4 deletions src/graphql-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15524,7 +15524,7 @@ export type introspection = {
import * as gqlTada from 'gql.tada';

declare module 'gql.tada' {
interface setupSchema {
introspection: introspection;
}
}
interface setupSchema {
introspection: introspection
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,13 @@
<IntersectionObserver
on:intersect={(e) => {
if (e.detail) {
client.mutation(updateChapter, {
id: chapter.chapterID,
lastPageRead: chapter.pages.length,
isRead: true
});
client
.mutation(updateChapter, {
id: chapter.chapterID,
lastPageRead: chapter.pages.length,
isRead: true
})
.toPromise();
LoadNextChapter(currentChapterID);
}
}}
Expand Down
40 changes: 24 additions & 16 deletions src/routes/(app)/settings/categories/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,42 @@
switch (movement) {
case Movement.top:
if (cat.order !== 1) {
client.mutation(updateCategoryOrder, {
id: cat.id,
position: 1
});
client
.mutation(updateCategoryOrder, {
id: cat.id,
position: 1
})
.toPromise();
}
break;
case Movement.up:
if (cat.order !== 1) {
client.mutation(updateCategoryOrder, {
id: cat.id,
position: cat.order - 1
});
client
.mutation(updateCategoryOrder, {
id: cat.id,
position: cat.order - 1
})
.toPromise();
}
break;
case Movement.down:
if (cat.order !== $cats.data.categories.nodes.length - 1) {
client.mutation(updateCategoryOrder, {
id: cat.id,
position: cat.order + 1
});
client
.mutation(updateCategoryOrder, {
id: cat.id,
position: cat.order + 1
})
.toPromise();
}
break;
default:
if (cat.order !== $cats.data?.categories.nodes.length - 1) {
client.mutation(updateCategoryOrder, {
id: cat.id,
position: $cats.data.categories.nodes.length - 1
});
client
.mutation(updateCategoryOrder, {
id: cat.id,
position: $cats.data.categories.nodes.length - 1
})
.toPromise();
}
break;
}
Expand Down
16 changes: 9 additions & 7 deletions src/routes/(app)/settings/categories/CategoriesEditModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
const client = getContextClient();
function submitChange(): void {
client.mutation(updateCategory, {
id: cat.id,
name: catinput,
default: Defaul,
includeInDownload: includeInDownload ? 'INCLUDE' : 'EXCLUDE',
includeInUpdate: includeInUpdate ? 'INCLUDE' : 'EXCLUDE'
});
client
.mutation(updateCategory, {
id: cat.id,
name: catinput,
default: Defaul,
includeInDownload: includeInDownload ? 'INCLUDE' : 'EXCLUDE',
includeInUpdate: includeInUpdate ? 'INCLUDE' : 'EXCLUDE'
})
.toPromise();
parent.onClose();
}
</script>
Expand Down
14 changes: 8 additions & 6 deletions src/routes/(app)/settings/categories/CategoriesNewModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
const client = getContextClient();
async function submitChange(): Promise<void> {
client.mutation(createCategory, {
name: catinput,
default: Defaul,
includeInDownload: includeInDownload ? 'INCLUDE' : 'INCLUDE',
includeInUpdate: includeInUpdate ? 'INCLUDE' : 'INCLUDE'
});
client
.mutation(createCategory, {
name: catinput,
default: Defaul,
includeInDownload: includeInDownload ? 'INCLUDE' : 'INCLUDE',
includeInUpdate: includeInUpdate ? 'INCLUDE' : 'INCLUDE'
})
.toPromise();
parent.onClose();
}
</script>
Expand Down
10 changes: 6 additions & 4 deletions src/routes/trackers/auth/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
const state: { trackerId: number } = JSON.parse(
url.searchParams.get('state') ?? '{}'
);
client.mutation(loginTrackerOAuth, {
callbackUrl: url.href,
trackerId: state.trackerId
});
await client
.mutation(loginTrackerOAuth, {
callbackUrl: url.href,
trackerId: state.trackerId
})
.toPromise();
localStorage.setItem('VUI3_TRACKER_LOGIN', 'true');
window.close();
}
Expand Down
2 changes: 1 addition & 1 deletion versionToServerVersionMapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
{
"tag": "v1.0.0",
"uiVersion": "r551",
"uiVersion": "r560",
"serverVersion": "r1498"
}
]

0 comments on commit b843919

Please sign in to comment.