Prevent add subdir to paths mutiple times

pull/5304/head
Rodrigo Nascimento 9 years ago
parent cd496d07e9
commit 5e20ca6fa1
No known key found for this signature in database
GPG Key ID: 2C85B3AFE75D23F9
  1. 2
      client/routes/roomRoute.js
  2. 13
      packages/rocketchat-lib/lib/roomTypesCommon.coffee
  3. 2
      packages/rocketchat-livechat/client/views/sideNav/livechat.js
  4. 2
      packages/rocketchat-slashcommands-open/client.js
  5. 2
      packages/rocketchat-ui/views/app/spotlight/spotlight.coffee

@ -1,6 +1,6 @@
FlowRouter.goToRoomById = (roomId) => {
const subscription = ChatSubscription.findOne({rid: roomId});
if (subscription) {
FlowRouter.go(RocketChat.roomTypes.getRouteLink(subscription.t, subscription), null, FlowRouter.current().queryParams);
RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
}
};

@ -60,3 +60,16 @@ class @roomTypesCommon
return FlowRouter.path @roomTypes[roomType].route.name, routeData
openRouteLink: (roomType, subData, queryParams) ->
unless @roomTypes[roomType]?
return false
routeData = {}
if @roomTypes[roomType]?.route?.link?
routeData = @roomTypes[roomType].route.link(subData)
else if subData?.name?
routeData = { name: subData.name }
return FlowRouter.go @roomTypes[roomType].route.name, routeData, queryParams

@ -114,7 +114,7 @@ Template.livechat.events({
if (isConfirm) {
Meteor.call('livechat:takeInquiry', this._id, (error, result) => {
if (!error) {
FlowRouter.go(RocketChat.roomTypes.getRouteLink(result.t, result));
RocketChat.roomTypes.openRouteLink(result.t, result);
}
});
}

@ -22,7 +22,7 @@ function Open(command, params/*, item*/) {
subscription = ChatSubscription.findOne(query);
if (subscription) {
FlowRouter.go(RocketChat.roomTypes.getRouteLink(subscription.t, subscription), null, FlowRouter.current().queryParams);
RocketChat.roomTypes.openRouteLink(subscription.t, subscription, FlowRouter.current().queryParams);
}
}

@ -57,7 +57,7 @@ Template.spotlight.helpers
getValue: (_id, collection, records, firstPartValue) ->
doc = _.findWhere(records, {_id: _id})
FlowRouter.go(RocketChat.roomTypes.getRouteLink(doc.t, doc), null, FlowRouter.current().queryParams)
RocketChat.roomTypes.openRouteLink(doc.t, doc, FlowRouter.current().queryParams)
spotlight.hide()

Loading…
Cancel
Save