Gitter migration: Setup redirects (rollout pt. 3)
[gitter.git] / modules / uri-resolver / lib / uri-context-as-browser-state.js
blobf05a83a3a20d5c3d62f132e5e6ba7aecf9871f8b
1 'use strict';
3 function uriContextAsBrowserState(uriContext) {
4 if (uriContext.ownUrl) {
5 return {
6 uri: uriContext.uri,
7 type: 'home'
8 };
11 var troupe = uriContext.troupe;
12 if (troupe) {
13 return {
14 uri: uriContext.uri,
15 type: 'room',
16 roomId: troupe.id
20 var group = uriContext.group;
21 if (uriContext.group) {
22 return {
23 uri: uriContext.uri,
24 type: 'group',
25 groupId: group.id
30 module.exports = uriContextAsBrowserState;