Skip to content

Commit

Permalink
Merge pull request #220 from Suwayomi/main
Browse files Browse the repository at this point in the history
fix source preference saving
  • Loading branch information
Robonau authored Aug 28, 2024
2 parents 5ab0ac0 + 264d25f commit 7991257
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Slide from '$lib/components/Slide.svelte';
import { updateSourcePreference } from '$lib/gql/Mutations';
import type { getSource } from '$lib/gql/Queries';
import { getContextClient, queryStore } from '@urql/svelte';
import { getContextClient } from '@urql/svelte';
import type { ResultOf } from '$lib/gql/graphql';
export let pref: Extract<
Expand All @@ -24,15 +24,13 @@
let checked = pref.CheckBoxCheckBoxCurrentValue ?? pref.CheckBoxDefault;
const client = getContextClient();
function handelcheck(state: CustomEvent<boolean>) {
queryStore({
client,
query: updateSourcePreference,
variables: {
client
.mutation(updateSourcePreference, {
source: id,
checkBoxState: state.detail,
position: index
}
});
})
.toPromise();
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { popup } from '@skeletonlabs/skeleton';
import { updateSourcePreference } from '$lib/gql/Mutations';
import type { getSource } from '$lib/gql/Queries';
import { getContextClient, queryStore } from '@urql/svelte';
import { getContextClient } from '@urql/svelte';
import type { ResultOf } from '$lib/gql/graphql';
export let pref: Extract<
Expand All @@ -23,15 +23,13 @@
let value = pref.EditTextCurrentValue ?? pref.EditTextDefault;
const client = getContextClient();
function handelChange() {
queryStore({
client,
query: updateSourcePreference,
variables: {
client
.mutation(updateSourcePreference, {
source: id,
editTextState: value,
position: index
}
});
})
.toPromise();
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script lang="ts">
import { updateSourcePreference } from '$lib/gql/Mutations';
import type { getSource } from '$lib/gql/Queries';
import { getContextClient, queryStore } from '@urql/svelte';
import { getContextClient } from '@urql/svelte';
import type { ResultOf } from '$lib/gql/graphql';
export let pref: Extract<
Expand All @@ -23,15 +23,13 @@
let selected = pref.ListCurrentValue ?? pref.ListDefault;
const client = getContextClient();
function handelchange() {
queryStore({
client,
query: updateSourcePreference,
variables: {
client
.mutation(updateSourcePreference, {
source: id,
listState: selected,
position: index
}
});
})
.toPromise();
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { popup } from '@skeletonlabs/skeleton';
import { updateSourcePreference } from '$lib/gql/Mutations';
import type { getSource } from '$lib/gql/Queries';
import { getContextClient, queryStore } from '@urql/svelte';
import { getContextClient } from '@urql/svelte';
import type { ResultOf } from '$lib/gql/graphql';
export let pref: Extract<
Expand All @@ -25,15 +25,13 @@
pref.MultiSelectListCurrentValue ?? pref.MultiSelectListDefault;
const client = getContextClient();
function handelchange() {
queryStore({
client,
query: updateSourcePreference,
variables: {
client
.mutation(updateSourcePreference, {
source: id,
multiSelectState: selected,
position: index
}
});
})
.toPromise();
}
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Slide from '$lib/components/Slide.svelte';
import { updateSourcePreference } from '$lib/gql/Mutations';
import type { getSource } from '$lib/gql/Queries';
import { getContextClient, queryStore } from '@urql/svelte';
import { getContextClient } from '@urql/svelte';
import type { ResultOf } from '$lib/gql/graphql';
export let pref: Extract<
Expand All @@ -24,15 +24,13 @@
let checked = pref.SwitchCurrentValue ?? pref.SwitchDefault;
const client = getContextClient();
function handelcheck(state: CustomEvent<boolean>) {
queryStore({
client,
query: updateSourcePreference,
variables: {
client
.mutation(updateSourcePreference, {
source: id,
switchState: state.detail,
position: index
}
});
})
.toPromise();
}
</script>

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.1.0",
"uiVersion": "r1110",
"uiVersion": "r1113",
"serverVersion": "r1502",
"comment": "the server version is between 1.0.0 and 1.1.0 release",
"comment2": "because its the preview version that implemented the breaking changes"
Expand Down

0 comments on commit 7991257

Please sign in to comment.