Skip to content

Commit

Permalink
Fix UI config mutation not working (#4533)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored Feb 9, 2024
1 parent a16f3da commit 79e72ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/v2.5/graphql/client-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ extend input SetDefaultFilterInput {
}

extend type Mutation {
configureUI(input: UIConfig!): UIConfig!
configureUI(input: Map!): UIConfig!
}
2 changes: 1 addition & 1 deletion ui/v2.5/graphql/mutations/config.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mutation ConfigureDefaults($input: ConfigDefaultSettingsInput!) {
}
}

mutation ConfigureUI($input: UIConfig!) {
mutation ConfigureUI($input: Map!) {
configureUI(input: $input)
}

Expand Down
4 changes: 3 additions & 1 deletion ui/v2.5/src/components/Settings/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});

Expand Down

0 comments on commit 79e72ff

Please sign in to comment.