Checking if helpers are not registered before register to avoid overriding
This commit is contained in:
1 parent
66df591166
commit
a8ee17dc71
3 files changed
+13
-3
No files matched your search
@@ -27,6 +27,9 @@ const formatTM = (context, options) => {
|
||||
return dateTime.format(format);
|
||||
};
|
||||
|
||||
Blaze.registerHelper('formatTM', formatTM);
|
||||
// Check if global helper already exists to not override it
|
||||
if (!Blaze._getGlobalHelper('formatTM')) {
|
||||
Blaze.registerHelper('formatTM', formatTM);
|
||||
}
|
||||
|
||||
export { formatTM };
|
||||
Reference in new issue
Block a user