removing Utils.getCurrentSetting() and use ReactiveCache directly

This commit is contained in:
Martin Filser 2023-07-20 21:08:39 +02:00
parent a8c071f04c
commit 875442f1ce
8 changed files with 17 additions and 17 deletions

View file

@ -1,7 +1,9 @@
import { ReactiveCache } from '/imports/reactiveCache';
Template.invitationCode.onRendered(function() {
Meteor.subscribe('setting', {
onReady() {
const setting = Utils.getCurrentSetting();
const setting = ReactiveCache.getCurrentSetting();
if (!setting || !setting.disableRegistration) {
$('#invitationcode').hide();

View file

@ -58,16 +58,16 @@ BlazeComponent.extendComponent({
},
toggleForgotPassword() {
this.setLoading(true);
const forgotPasswordClosed = Utils.getCurrentSetting().disableForgotPassword;
Settings.update(Utils.getCurrentSetting()._id, {
const forgotPasswordClosed = ReactiveCache.getCurrentSetting().disableForgotPassword;
Settings.update(ReactiveCache.getCurrentSetting()._id, {
$set: { disableForgotPassword: !forgotPasswordClosed },
});
this.setLoading(false);
},
toggleRegistration() {
this.setLoading(true);
const registrationClosed = Utils.getCurrentSetting().disableRegistration;
Settings.update(Utils.getCurrentSetting()._id, {
const registrationClosed = ReactiveCache.getCurrentSetting().disableRegistration;
Settings.update(ReactiveCache.getCurrentSetting()._id, {
$set: { disableRegistration: !registrationClosed },
});
this.setLoading(false);
@ -163,7 +163,7 @@ BlazeComponent.extendComponent({
.trim();
const from = this.checkField('#mail-server-from');
const tls = $('#mail-server-tls.is-checked').length > 0;
Settings.update(Utils.getCurrentSetting()._id, {
Settings.update(ReactiveCache.getCurrentSetting()._id, {
$set: {
'mailServer.host': host,
'mailServer.port': port,
@ -243,7 +243,7 @@ BlazeComponent.extendComponent({
const spinnerName = $('#spinnerName').val();
try {
Settings.update(Utils.getCurrentSetting()._id, {
Settings.update(ReactiveCache.getCurrentSetting()._id, {
$set: {
productName,
hideLogo: hideLogoChange,