Skip to content

Commit

Permalink
[Glitch] Fix missing redirections to make sure /home redirect to the …
Browse files Browse the repository at this point in the history
…advanced UI

Port 935d541 to glitch-soc

Signed-off-by: Claire <[email protected]>
  • Loading branch information
Signez authored and ClearlyClaire committed Oct 17, 2023
1 parent c10a667 commit 8bbbd01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/javascript/flavours/glitch/features/ui/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ class SwitchingColumnsArea extends PureComponent {

{singleColumn ? <Redirect from='/deck' to='/home' exact /> : null}
{singleColumn && pathName.startsWith('/deck/') ? <Redirect from={pathName} to={pathName.slice(5)} /> : null}
{/* Redirect old bookmarks (without /deck) with home-like routes to the advanced interface */}
{!singleColumn && pathName === '/getting-started' ? <Redirect from='/getting-started' to='/deck/getting-started' exact /> : null}
{!singleColumn && pathName === '/home' ? <Redirect from='/home' to='/deck/getting-started' exact /> : null}

<WrappedRoute path='/getting-started' component={GettingStarted} content={children} />
<WrappedRoute path='/keyboard-shortcuts' component={KeyboardShortcuts} content={children} />
Expand Down
1 change: 1 addition & 0 deletions app/javascript/flavours/glitch/initial_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const initialPath = document.querySelector("head meta[name=initialPath]")?.getAt
/** @type {boolean} */
export const hasMultiColumnPath = initialPath === '/'
|| initialPath === '/getting-started'
|| initialPath === '/home'
|| initialPath.startsWith('/deck');

/**
Expand Down

0 comments on commit 8bbbd01

Please sign in to comment.