import Ember from 'ember';

const { HistoryLocation} = Ember;
const get = Ember.get;

export default {
  name: 'chat-routing',
  initialize: function () {
    HistoryLocation.reopen({
      getURL: function () {
        let rootURL = get(this, 'rootURL').replace(/\/$/, ''),
          url = get(this, 'location').pathname,
          search = get(this, 'location').search;
        url = url.replace(rootURL, '');
        return url + search;
      }
    });
  }
};
