rocketchat-lib part1#6553
Conversation
| @@ -0,0 +1,19 @@ | |||
| /* globals LoggerManager */ | |||
| RocketChat.settings.get('Log_Package', function(key, value) { | |||
| return (typeof LoggerManager !== 'undefined') && LoggerManager !== null && (LoggerManager.showPackage = value); | |||
There was a problem hiding this comment.
Simplify to LoggerManager && LoggerManager.showPackage = value;
There was a problem hiding this comment.
actually, if the variable LoggerManager have never been declared, It will throw an exception
LoggerManager && LoggerManager.showPackage = value; // Uncaught ReferenceError: LoggerManager is not definedtypeof LoggerManager != 'undefined' && LoggerManager.showPackage = value; // nothing happens| }); | ||
|
|
||
| RocketChat.settings.get('Log_File', function(key, value) { | ||
| return typeof LoggerManager !== 'undefined' && LoggerManager !== null && (LoggerManager.showFileAndLine = value); |
|
|
||
| RocketChat.settings.get('Log_Level', function(key, value) { | ||
| if (value != null) { | ||
| if (typeof LoggerManager !== 'undefined' && LoggerManager !== null) { |
There was a problem hiding this comment.
Simplify to LoggerManager != null
| LoggerManager.logLevel = parseInt(value); | ||
| } | ||
| Meteor.setTimeout(() => { | ||
| return typeof LoggerManager !== 'undefined' && LoggerManager !== null && LoggerManager.enable(true); |
| @@ -0,0 +1,8 @@ | |||
|
|
|||
| @@ -0,0 +1,1006 @@ | |||
| RocketChat.settings.add('uniqueID', process.env.DEPLOYMENT_ID || Random.id(), { | |||
| hidden: true | ||
| }); | ||
|
|
||
| RocketChat.settings.addGroup('Accounts', function() { |
| /* globals WebAppInternals*/ | ||
| RocketChat.settings.onload('CDN_PREFIX', function(key, value) { | ||
| if (_.isString(value || false)) { | ||
| return typeof WebAppInternals !== 'undefined' && WebAppInternals !== null && WebAppInternals.setBundledJsCssPrefix(value); |
|
|
||
| Meteor.startup(function() { | ||
| const value = RocketChat.settings.get('CDN_PREFIX'); | ||
| if (_.isString(value || false)) { |
There was a problem hiding this comment.
Any string value will be considered true?
There was a problem hiding this comment.
My wish was testing if the variable is a string or it is not an empty string.
"asda"||false - > "asda"""||false - > falsebecause _.isString("") === true
There was a problem hiding this comment.
Ok, but that looks strange and will allow spaces. What about if (_.isString(value) && value.trim()) just to be more clear?
| Meteor.startup(function() { | ||
| const value = RocketChat.settings.get('CDN_PREFIX'); | ||
| if (_.isString(value || false)) { | ||
| return typeof WebAppInternals !== 'undefined' && WebAppInternals !== null && WebAppInternals.setBundledJsCssPrefix(value); |
|
|
||
| RocketChat.settings.get('Log_Package', function(key, value) { | ||
| return (typeof LoggerManager !== 'undefined') && LoggerManager !== null && (LoggerManager.showPackage = value); | ||
| return log(LoggerManager => LoggerManager.showPackage = value); |
There was a problem hiding this comment.
Why not LoggerManager && LoggerManager.showPackage = value?
| RocketChat.settings.onload('CDN_PREFIX', function(key, value) { | ||
| if (_.isString(value || false)) { | ||
| return typeof WebAppInternals !== 'undefined' && WebAppInternals !== null && WebAppInternals.setBundledJsCssPrefix(value); | ||
| return testWebAppInternals(WebAppInternals => WebAppInternals.setBundledJsCssPrefix(value)); |
There was a problem hiding this comment.
Why not WebAppInternals && WebAppInternals.setBundledJsCssPrefix(value)?
|
@ggazzo Can you fix the conflicts? |
|
yes, I can. |
…nto rocketchat-lib
No description provided.