Remove /deck prefix
This commit is contained in:
parent
d7254bd332
commit
d35cbe4473
3 changed files with 6 additions and 15 deletions
|
@ -21,11 +21,7 @@ browserHistory.push = (path: string, state?: MastodonLocationState) => {
|
|||
state = state ?? {};
|
||||
state.fromMastodon = true;
|
||||
|
||||
if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) {
|
||||
originalPush(`/deck${path}`, state);
|
||||
} else {
|
||||
originalPush(path, state);
|
||||
}
|
||||
originalPush(path, state);
|
||||
};
|
||||
|
||||
browserHistory.replace = (path: string, state?: MastodonLocationState) => {
|
||||
|
@ -34,11 +30,7 @@ browserHistory.replace = (path: string, state?: MastodonLocationState) => {
|
|||
state.fromMastodon = true;
|
||||
}
|
||||
|
||||
if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) {
|
||||
originalReplace(`/deck${path}`, state);
|
||||
} else {
|
||||
originalReplace(path, state);
|
||||
}
|
||||
originalReplace(path, state);
|
||||
};
|
||||
|
||||
export const Router: React.FC<PropsWithChildren> = ({ children }) => {
|
||||
|
|
|
@ -174,7 +174,7 @@ class SwitchingColumnsArea extends PureComponent {
|
|||
if (singleColumn) {
|
||||
redirect = <Redirect from='/' to='/home' exact />;
|
||||
} else {
|
||||
redirect = <Redirect from='/' to='/deck/getting-started' exact />;
|
||||
redirect = <Redirect from='/' to='/getting-started' exact />;
|
||||
}
|
||||
} else if (singleUserMode && owner && initialState?.accounts[owner]) {
|
||||
redirect = <Redirect from='/' to={`/@${initialState.accounts[owner].username}`} exact />;
|
||||
|
@ -189,9 +189,8 @@ class SwitchingColumnsArea extends PureComponent {
|
|||
<WrappedSwitch>
|
||||
{redirect}
|
||||
|
||||
{singleColumn ? <Redirect from='/deck' to='/home' exact /> : null}
|
||||
{singleColumn && pathName.startsWith('/deck/') ? <Redirect from={pathName} to={pathName.slice(5)} /> : null}
|
||||
{!singleColumn && pathName === '/getting-started' ? <Redirect from='/getting-started' to='/deck/getting-started' exact /> : null}
|
||||
{singleColumn ? <Redirect from='/getting-started' to='/home' exact /> : null}
|
||||
{pathName.startsWith('/deck/') ? <Redirect from={pathName} to={pathName.slice(5)} /> : null}
|
||||
|
||||
<WrappedRoute path='/getting-started' component={GettingStarted} content={children} />
|
||||
<WrappedRoute path='/keyboard-shortcuts' component={KeyboardShortcuts} content={children} />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<link rel="manifest" type="applicaton/manifest+json" href="/manifest.json" />
|
||||
|
||||
<meta name="theme-color" content="#282c37" />
|
||||
<meta content='/deck/getting-started' name='initialPath' />
|
||||
<meta content='/getting-started' name='initialPath' />
|
||||
|
||||
<link rel='preload' as='script' href='/packs/js/locales/glitch/en-json.js' />
|
||||
<link rel='preload' as='script' href='/packs/js/flavours/glitch/async/getting_started.js' />
|
||||
|
|
Loading…
Reference in a new issue