@@ -10,7 +10,7 @@ import * as React from "react";
1010import type { WithTranslation } from "react-i18next" ;
1111import { withTranslation } from "react-i18next" ;
1212import type { RouteComponentProps , StaticContext } from "react-router" ;
13- import { Prompt , withRouter , Redirect } from "react-router" ;
13+ import { Prompt , withRouter } from "react-router" ;
1414import { toast } from "sonner" ;
1515import styled from "styled-components" ;
1616import breakpoint from "styled-components-breakpoint" ;
@@ -40,11 +40,7 @@ import type { Editor as TEditor } from "~/editor";
4040import type { Properties } from "~/types" ;
4141import { client } from "~/utils/ApiClient" ;
4242import { emojiToUrl } from "~/utils/emoji" ;
43- import {
44- documentHistoryPath ,
45- documentEditPath ,
46- updateDocumentPath ,
47- } from "~/utils/routeHelpers" ;
43+ import { documentHistoryPath , documentEditPath } from "~/utils/routeHelpers" ;
4844import Container from "./Container" ;
4945import Contents from "./Contents" ;
5046import Editor from "./Editor" ;
@@ -476,10 +472,6 @@ class DocumentScene extends React.Component<Props> {
476472 const multiplayerEditor =
477473 ! document . isArchived && ! document . isDeleted && ! revision && ! isShare ;
478474
479- const canonicalUrl = shareId
480- ? this . props . match . url
481- : updateDocumentPath ( this . props . match . url , document ) ;
482-
483475 const hasEmojiInTitle = determineIconType ( document . icon ) === IconType . Emoji ;
484476 const title = hasEmojiInTitle
485477 ? document . titleWithDefault . replace ( document . icon ! , "" )
@@ -492,15 +484,6 @@ class DocumentScene extends React.Component<Props> {
492484
493485 return (
494486 < ErrorBoundary showTitle >
495- { this . props . location . pathname !== canonicalUrl && (
496- < Redirect
497- to = { {
498- pathname : canonicalUrl ,
499- state : this . props . location . state ,
500- hash : this . props . location . hash ,
501- } }
502- />
503- ) }
504487 < RegisterKeyDown trigger = "m" handler = { this . onMove } />
505488 < RegisterKeyDown trigger = "z" handler = { this . onUndoRedo } />
506489 < RegisterKeyDown trigger = "e" handler = { this . goToEdit } />
@@ -670,10 +653,9 @@ const Main = styled.div<MainProps>`
670653 @media print {
671654 display: block;
672655 max-width: ${ ( { fullWidth } : MainProps ) =>
673- fullWidth
674- ? `100%`
675- : `calc(${ EditorStyleHelper . documentWidth } + ${ EditorStyleHelper . documentGutter } )`
676- } ;
656+ fullWidth
657+ ? `100%`
658+ : `calc(${ EditorStyleHelper . documentWidth } + ${ EditorStyleHelper . documentGutter } )` } ;
677659 }
678660` ;
679661
@@ -722,10 +704,10 @@ const EditorContainer = styled.div<EditorContainerProps>`
722704
723705 // Decides the editor column position & span
724706 grid-column: ${ ( {
725- docFullWidth,
726- showContents,
727- tocPosition,
728- } : EditorContainerProps ) =>
707+ docFullWidth,
708+ showContents,
709+ tocPosition,
710+ } : EditorContainerProps ) =>
729711 docFullWidth
730712 ? showContents
731713 ? tocPosition === TOCPosition . Left
0 commit comments