Skip to content
Snippets Groups Projects
Commit 91e9f16b authored by Gabriel Engel's avatar Gabriel Engel
Browse files

fixed typo

parent a3bc930f
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ RocketChat.settings.add = (_id, value, options = {}) ->
options.packageValue = value
options.valueSource = 'packageValue'
options.ts = new Date
if process?.env?[_id]?
value = process.env[_id]
......@@ -30,19 +31,12 @@ RocketChat.settings.add = (_id, value, options = {}) ->
if not options.i18nDescription?
options.i18nDescription = "#{_id}_Description"
upsertChanges =
return RocketChat.models.Settings.upsert { _id: _id },
$set: options
$setOnInsert:
value: value
createdAt: new Date
if options.persistent is true
upsertChanges.$unset = { ts: true }
else
upsertChanges.$set.ts = new Date
return RocketChat.models.Settings.upsert { _id: _id }, upsertChanges
###
# Add a setting group
......@@ -60,19 +54,14 @@ RocketChat.settings.addGroup = (_id, options = {}) ->
if not options.i18nDescription?
options.i18nDescription = "#{_id}_Description"
upsertChanges =
options.ts = new Date
return RocketChat.models.Settings.upsert { _id: _id },
$set: options
$setOnInsert:
type: 'group'
createdAt: new Date
if options.persistent is true
upsertChanges.$unset = { ts: true }
else
upsertChanges.$set.ts = new Date
return RocketChat.models.Settings.upsert { _id: _id }, upsertChanges
###
# Remove a setting by id
......
......@@ -121,5 +121,5 @@ Meteor.startup ->
# Remove runtime settings (non-persistent)
Meteor.startup ->
RocketChat.models.Settings.update({ ts: { $lt: RocketChat.settings.ts } }, { $set: { hidden: true } })
RocketChat.models.Settings.update({ ts: { $lt: RocketChat.settings.ts }, persistent: false }, { $set: { hidden: true } })
RocketChat.settings.onload 'CDN_PREFIX', (key, value, initialLoad) ->
if value?.trim() isnt ''
WebAppInternals.setBundledJsCssPrefix value
WebAppInternals?.setBundledJsCssPrefix value
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment