update Markdown skills

This commit is contained in:
2026-08-19 17:36:27 +05:30
parent aa2fb41871
commit d3f7f439f6
30 changed files with 2341 additions and 221 deletions

View File

@@ -42,13 +42,21 @@ export function usePreferences() {
return { ...base44.auth.preferences(), ...(user?.preferences || {}) };
}
/** Writes one or more preferences and refreshes every consumer of `['user']`. */
/**
* Writes one or more preferences and refreshes every consumer of `['user']`.
*
* The mutation resolves to `{ user, persisted, error }`, not to the user — a
* caller storing something it needs back after a reload, which is every caller
* writing `customSkills`, has to be able to tell a write that landed from one
* the browser refused. The cache is updated either way: the change is real for
* this session even when it could not be stored.
*/
export function useUpdatePreferences() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: /** @param {any} patch */ (patch) => base44.auth.updatePreferences(patch),
onSuccess: (user) => {
queryClient.setQueryData(['user'], user);
onSuccess: /** @param {any} result */ (result) => {
queryClient.setQueryData(['user'], result.user);
queryClient.invalidateQueries({ queryKey: ['user'] });
},
});