The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/hooks/useDontAskAgain.ts

10 lines
432 B

import { useUserPreference } from '@rocket.chat/ui-contexts';
export type DontAskAgainList = Array<{ action: string; label: string }>;
export const useDontAskAgain = (action: string): boolean => {
const dontAskAgainList = useUserPreference<DontAskAgainList>('dontAskAgainList');
const shouldNotAskAgain = !!dontAskAgainList?.filter(({ action: currentAction }) => action === currentAction).length;
return shouldNotAskAgain;
};