bigbluebutton-Github/bigbluebutton-html5/imports/ui/services/settings/hooks/useUserChangedLocalSettings.ts

20 lines
549 B
TypeScript
Raw Normal View History

2024-01-30 21:03:11 +08:00
import { useCallback } from 'react';
import { useMutation } from '@apollo/client';
import { USER_CHANGED_LOCAL_SETTINGS } from './mutations';
const useUserChangedLocalSettings = () => {
const [userChangedLocalSettings] = useMutation(USER_CHANGED_LOCAL_SETTINGS);
2024-01-30 22:07:10 +08:00
const setLocalSettings = (settings: Record<string, unknown>) => {
2024-01-30 21:03:11 +08:00
return userChangedLocalSettings({
variables: {
settings,
2024-01-30 21:03:11 +08:00
},
});
};
return useCallback(setLocalSettings, [userChangedLocalSettings]);
};
export default useUserChangedLocalSettings;