Skip to content

Commit

Permalink
return to sessions list after current is closed (#112)
Browse files Browse the repository at this point in the history
fixes #106
  • Loading branch information
lanwen authored Jun 2, 2018
1 parent 73bc394 commit c2a3e0e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 30 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"react": "15.4.2",
"react-dom": "15.4.2",
"react-highlight": "0.10.0",
"react-router-dom": "next",
"react-router-dom": "4.2.2",
"react-select": "1.0.0-rc.4",
"react-spinners": "0.2.6",
"react-transition-group": "^2.3.1",
Expand Down
13 changes: 12 additions & 1 deletion web/src/components/Session/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import React, {Component} from "react";
import {withRouter} from 'react-router-dom'

import SessionInfo from "./SessionInfo";
import VncCard from "../VncCard";
import Log from "../Log";
import "./style.scss";


export default class Session extends Component {
class Session extends Component {
componentDidUpdate({browser}) {
const {history} = this.props;
if (browser && !this.props.browser) {
history.push('/')
}
}

render() {
const {origin, session, browser} = this.props;

Expand Down Expand Up @@ -35,6 +44,8 @@ export default class Session extends Component {
}
}

export default withRouter(Session);

function VncContainer({origin, session, browser = {}}) {
if (browser.caps && !browser.caps.enableVNC) {
return <span/>
Expand Down
56 changes: 28 additions & 28 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2620,14 +2620,14 @@ highlight.js@^9.11.0:
version "9.11.0"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.11.0.tgz#47f98c7399918700db2caf230ded12cec41a84ae"

history@^4.5.1, history@^4.6.0:
version "4.6.1"
resolved "https://registry.yarnpkg.com/history/-/history-4.6.1.tgz#911cf8eb65728555a94f2b12780a0c531a14d2fd"
history@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
resolve-pathname "^2.0.0"
value-equal "^0.2.0"
resolve-pathname "^2.2.0"
value-equal "^0.4.0"
warning "^3.0.0"

hmac-drbg@^1.0.0:
Expand All @@ -2642,11 +2642,7 @@ [email protected]:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"

hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"

hoist-non-react-statics@^2.3.1:
hoist-non-react-statics@^2.3.0, hoist-non-react-statics@^2.3.1:
version "2.5.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"

Expand Down Expand Up @@ -3816,7 +3812,7 @@ [email protected]:
version "0.1.7"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"

path-to-regexp@^1.5.3:
path-to-regexp@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
dependencies:
Expand Down Expand Up @@ -4320,22 +4316,26 @@ react-proxy@^1.1.7:
lodash "^4.6.1"
react-deep-force-update "^1.0.0"

react-router-dom@next:
version "4.0.0-beta.8"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.0.0-beta.8.tgz#907a5a0a36e9190652c80f2feead0eadbbba262e"
react-router-dom@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.2.2.tgz#c8a81df3adc58bba8a76782e946cbd4eae649b8d"
dependencies:
history "^4.5.1"
react-router "^4.0.0-beta.8"
history "^4.7.2"
invariant "^2.2.2"
loose-envify "^1.3.1"
prop-types "^15.5.4"
react-router "^4.2.0"
warning "^3.0.0"

react-router@^4.0.0-beta.8:
version "4.1.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.1.1.tgz#d448f3b7c1b429a6fbb03395099949c606b1fe95"
react-router@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.2.0.tgz#61f7b3e3770daeb24062dae3eedef1b054155986"
dependencies:
history "^4.6.0"
hoist-non-react-statics "^1.2.0"
history "^4.7.2"
hoist-non-react-statics "^2.3.0"
invariant "^2.2.2"
loose-envify "^1.3.1"
path-to-regexp "^1.5.3"
path-to-regexp "^1.7.0"
prop-types "^15.5.4"
warning "^3.0.0"

Expand Down Expand Up @@ -4633,9 +4633,9 @@ resolve-from@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226"

resolve-pathname@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.1.0.tgz#e8358801b86b83b17560d4e3c382d7aef2100944"
resolve-pathname@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879"

resolve@^1.1.6:
version "1.3.2"
Expand Down Expand Up @@ -5331,9 +5331,9 @@ validate-npm-package-license@^3.0.1:
spdx-correct "~1.0.0"
spdx-expression-parse "~1.0.0"

value-equal@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.2.1.tgz#c220a304361fce6994dbbedaa3c7e1a1b895871d"
value-equal@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-0.4.0.tgz#c5bdd2f54ee093c04839d71ce2e4758a6890abc7"

vary@~1.1.0:
version "1.1.0"
Expand Down

0 comments on commit c2a3e0e

Please sign in to comment.