I’m trying to show a alert warning for when a user first logs in, after their first login then I don’t want this message shown. So I’ve created this method:
Meteor.methods({
'firstLogin': function() {
if (Meteor.user().loggedInTimes === 0) {
return '<div class="alert alert-info alert-dismissible alertBar" role="alert"><br><button type="button" class="alertButton" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><b>Please take a few minutes to personalise your experience at SSAW by updating your <a href="/profile" class="alert-link hoverAlert">profile</a></b>. </div>';
}
}
});
I call it in Meteor.isClient
as:
if (Meteor.isClient) {
Template.myHome.helpers({
count: function(){
var user = Meteor.user();
//console.log(user);
if (user) {
Meteor.call('firstLogin');
}
}
});
}
This is the template
:
<template name="myHome">
<div class="container">
{{{ count }}}
<div class="text-center">
{{#if currentUser }}
<h1 class="roboto">Hi{{ username }}</h1>
{{/if}}
</div>
</div>
</template>
However this does not render any of the html from the method. How can I get the html alert message to appear?