Fix UI config mutation not working (#4533)

This commit is contained in:
WithoutPants 2024-02-09 12:27:08 +11:00 committed by GitHub
parent a16f3da33e
commit 79e72ff3bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -22,5 +22,5 @@ extend input SetDefaultFilterInput {
}
extend type Mutation {
configureUI(input: UIConfig!): UIConfig!
configureUI(input: Map!): UIConfig!
}

View file

@ -36,7 +36,7 @@ mutation ConfigureDefaults($input: ConfigDefaultSettingsInput!) {
}
}
mutation ConfigureUI($input: UIConfig!) {
mutation ConfigureUI($input: Map!) {
configureUI(input: $input)
}

View file

@ -423,13 +423,15 @@ export const SettingsContext: React.FC = ({ children }) => {
});
}
type UIConfigInput = GQL.Scalars["Map"]["input"];
// saves the configuration if no further changes are made after a half second
const saveUIConfig = useDebounce(async (input: IUIConfig) => {
try {
setUpdateSuccess(undefined);
await updateUIConfig({
variables: {
input,
input: input as UIConfigInput,
},
});