From 980fd4f61e0fb8086e1ffc9bc5e73c294b5febe4 Mon Sep 17 00:00:00 2001 From: Akuket <32392661+Akuket@users.noreply.github.com> Date: Mon, 16 Jul 2018 12:51:18 +0200 Subject: Patch Invitation Code --- client/components/settings/invitationCode.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'client/components') diff --git a/client/components/settings/invitationCode.js b/client/components/settings/invitationCode.js index a403d8ab..ce2e9a5b 100644 --- a/client/components/settings/invitationCode.js +++ b/client/components/settings/invitationCode.js @@ -1,6 +1,13 @@ -Template.invitationCode.onRendered(() => { - const setting = Settings.findOne(); - if (!setting || !setting.disableRegistration) { - $('#invitationcode').hide(); - } +Template.invitationCode.onRendered(function() { + Meteor.subscribe('setting', { + onReady : function() { + const setting = Settings.findOne(); + + if (!setting || !setting.disableRegistration) { + $('#invitationcode').hide(); + } + + return this.stop(); + } + }); }); -- cgit v1.2.3-1-g7c22 From 1b32509496f14d2d10a598a7005de6d6ced054ca Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 16 Jul 2018 14:46:33 +0300 Subject: Fix lint errors. --- client/components/settings/invitationCode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'client/components') diff --git a/client/components/settings/invitationCode.js b/client/components/settings/invitationCode.js index ce2e9a5b..fa355179 100644 --- a/client/components/settings/invitationCode.js +++ b/client/components/settings/invitationCode.js @@ -1,6 +1,6 @@ Template.invitationCode.onRendered(function() { Meteor.subscribe('setting', { - onReady : function() { + onReady() { const setting = Settings.findOne(); if (!setting || !setting.disableRegistration) { @@ -8,6 +8,6 @@ Template.invitationCode.onRendered(function() { } return this.stop(); - } + }, }); }); -- cgit v1.2.3-1-g7c22