mattermost-mobile/app/hooks/notification_props.ts
Daniel Espino García cff12f7182
Enable exhaustive deps in the repo (#9508)
* Enable exhaustive deps in the repo

* Add tests for the new hooks

* Update claude.md

* Remove pre-commit overwrite
2026-02-18 11:56:16 +01:00

18 lines
694 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {useMemo} from 'react';
import {getNotificationProps} from '@utils/user';
import type UserModel from '@typings/database/models/servers/user';
function useNotificationProps(currentUser?: UserModel) {
// We need to depend on the notifyProps object directly,
// since changes in it may not be reflected in the currentUser object
// (it is still the same object reference).
// eslint-disable-next-line react-hooks/exhaustive-deps
return useMemo(() => getNotificationProps(currentUser), [currentUser?.notifyProps]);
}
export default useNotificationProps;