Skip to content
Snippets Groups Projects
Commit 0904e08c authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Do not alert admins about wrong url if accessing from cordova

parent 8f275d7e
No related merge requests found
...@@ -32,16 +32,17 @@ RocketChat.settings.init = -> ...@@ -32,16 +32,17 @@ RocketChat.settings.init = ->
RocketChat.settings.init() RocketChat.settings.init()
Meteor.startup -> Meteor.startup ->
Tracker.autorun (c) -> if Meteor.isCordova is false
siteUrl = RocketChat.settings.get('Site_Url') Tracker.autorun (c) ->
if not siteUrl or not Meteor.userId()? siteUrl = RocketChat.settings.get('Site_Url')
return if not siteUrl or not Meteor.userId()?
return
if RocketChat.authz.hasRole(Meteor.userId(), 'admin') is false if RocketChat.authz.hasRole(Meteor.userId(), 'admin') is false
return c.stop() return c.stop()
siteUrl = siteUrl.replace /\/$/, '' siteUrl = siteUrl.replace /\/$/, ''
if siteUrl isnt location.origin if siteUrl isnt location.origin
toastr.warning TAPi18n.__('The_configured_URL_is_different_from_the_URL_you_are_accessing'), TAPi18n.__('Warning') toastr.warning TAPi18n.__('The_configured_URL_is_different_from_the_URL_you_are_accessing'), TAPi18n.__('Warning')
return c.stop() return c.stop()
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