Change of approach for the debounce

This commit is contained in:
André 2024-02-28 15:41:51 -03:00
parent f255f4b69e
commit 6cf3cd47fb
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,4 @@
import { makeCall } from '/imports/ui/services/api'; import { makeCall } from '/imports/ui/services/api';
import { debounce } from '/imports/utils/debounce';
const setPushLayout = (pushLayout) => { const setPushLayout = (pushLayout) => {
makeCall('setPushLayout', { pushLayout }); makeCall('setPushLayout', { pushLayout });
@ -11,5 +10,5 @@ const setMeetingLayout = (options) => {
export default { export default {
setPushLayout, setPushLayout,
setMeetingLayout: debounce(setMeetingLayout, 1000), setMeetingLayout,
}; };

View File

@ -22,6 +22,14 @@ export default injectIntl(withTracker(({ intl }) => {
if (obj.messageId === 'app.notification.userLeavePushAlert') { if (obj.messageId === 'app.notification.userLeavePushAlert') {
return UserService.UserLeftMeetingAlert(obj); return UserService.UserLeftMeetingAlert(obj);
} }
if (obj.messageId === 'app.layoutUpdate.label') {
const last = new Date(Session.get('lastLayoutUpdateNotification'));
const now = new Date();
if (now - last < 1000) {
return {};
}
Session.set('lastLayoutUpdateNotification', now);
}
notify( notify(
<FormattedMessage <FormattedMessage