const { useContext } = require('react');
const { useMethod } = require('/client/contexts/ServerContext.ts');
const { addAction } = require('/client/views/room/lib/Toolbox/index.tsx');
(() => {
addAction('hide-livechat-room', () => {
const hideRoom = useMethod('hideRoom');
return {
groups: ['channel', 'group', 'direct', 'direct_multiple', 'live'],
id: 'hide-livechat-room',
title: 'Hide',
icon: 'eye-off',
order: -2,
action: async () => {
const rid = Session.get('openedRoom');
await hideRoom(rid);
},
};
});
})();
Last active
March 10, 2021 01:53
-
-
Save Shailesh351/346e68ac8d67dc2046a3508ead23378a to your computer and use it in GitHub Desktop.
Rocket.Chat Custom Script to Add Hide Button in the Toolbar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment