I have the following code running in the /client directory, it doesn't set the company every time:
Tracker.autorun(function () {
var config = Meteor.subscribe('public_configuration');
if (config.ready()) {
var company = configurations.findOne({ configuration_type: 'public' });
console.log('meta config | company: ', company);
if (company && company.company_name) {
// Gets you 'Company Name' as a default title not 'Default Title'
console.log('meta config | company name: ', company.company_name);
Meta.config({
options: {
title: company.company_name,
suffix: company.company_name
}
});
}
}
});
I get this from the Chrome console, so I know it's picking up company name and running the code:
meta config | company: Object
meta-tracker.js:33 meta config | company name: Test Inc.
On initial load it will not set, then if I refresh the page the company name will get set properly. Then if I hit refresh again, it will revert back to localhost:3000
I have the following code running in the /client directory, it doesn't set the company every time:
I get this from the Chrome console, so I know it's picking up company name and running the code:
On initial load it will not set, then if I refresh the page the company name will get set properly. Then if I hit refresh again, it will revert back to localhost:3000
What am I doing wrong?