save working

pull/9526/head
Guilherme Gazzo 8 years ago
parent a020d5c7ea
commit 67b936ccaa
No known key found for this signature in database
GPG Key ID: 1F85C9AD922D0829
  1. 13
      packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js

@ -198,16 +198,21 @@ Template.pushNotificationsFlexTab.onCreated(function() {
if (this.original[field].get() === this.form[field].get()) {
return;
}
const value = this.form[field].get();
let value = this.form[field].get();
value = typeof value === 'boolean' ? value ? '1' : '0' : value;
const rid = Session.get('openedRoom');
switch (field) {
case 'desktopNotificationDuration':
return await call('saveDesktopNotificationDuration', rid, value);
await call('saveDesktopNotificationDuration', rid, value);
break;
case 'audioNotifications':
return await call('saveAudioNotificationValue', rid, value);
await call('saveAudioNotificationValue', rid, value);
break;
default:
return await call('saveNotificationSettings', field, value);
await call('saveNotificationSettings', rid, field, value);
}
this.original[field].set(this.form[field].get());
});
};

Loading…
Cancel
Save