Checking if helpers are not registered before register to avoid overriding

This commit is contained in:
Eloízio Salgado authored and Emanuel F. Oliveira committed 2017-01-29 22:11:18 -02:00
1 parent 66df591166
commit a8ee17dc71
3 files changed
+13 -3

No files matched your search

@@ -17,6 +17,9 @@ const formatDA = (context, format, options) => {
return dateAsMoment.format(strFormat);
};
Blaze.registerHelper('formatDA', formatDA);
// Check if global helper already exists to not override it
if (!Blaze._getGlobalHelper('formatDA')) {
Blaze.registerHelper('formatDA', formatDA);
}
export { formatDA };