Skip to content

Commit

Permalink
🔧 change route
Browse files Browse the repository at this point in the history
  • Loading branch information
hackape committed Apr 5, 2017
1 parent 5305396 commit af0d154
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions app/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ async function initialize () {

await step('[0] Get spaceKey from window.location', () => {
let spaceKey = null
if (config.isPlatform) {
const wsPathPattern = /^\/ws\/([^\/]+)$/
const match = wsPathPattern.exec(urlPath)
if (match) spaceKey = match[1]
}
const wsPathPattern = /^\/ws\/([^\/]+)\/?$/
const match = wsPathPattern.exec(urlPath)
if (match) spaceKey = match[1]

if (!spaceKey) spaceKey = qs.parse(window.location.hash.slice(1)).spaceKey
if (spaceKey) config.spaceKey = spaceKey
return true
Expand Down
2 changes: 1 addition & 1 deletion app/workspaces_standalone/WorkspaceList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class WorkspaceList extends Component {
<div className='workspace-name'>{ws.projectName}</div>
<div className='workspace-action'>
<a className='btn btn-default'
href={'/workspace.html#spaceKey=' + ws.spaceKey}
href={`/ws/${ws.spaceKey}`}
onClick={e => openWorkspace(ws)}>Open</a>
<button className='btn btn-danger'
style={{marginLeft: '4px'}}
Expand Down

0 comments on commit af0d154

Please sign in to comment.