File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,11 @@ const SnippngCodeArea = () => {
112112 // if there is a uid means we are on edit page where we want to avoid persisting the editor config
113113 if ( uid ) return ;
114114 // persist the editor config changes only when user is creating new snippet
115- LocalStorage . set ( "config" , { ...editorConfig , uid : undefined } ) ;
115+ LocalStorage . set ( "config" , {
116+ ...editorConfig ,
117+ uid : undefined ,
118+ ownerUid : undefined ,
119+ } ) ;
116120 } , [ editorConfig , uid ] ) ;
117121
118122 return (
@@ -255,7 +259,7 @@ const SnippngCodeArea = () => {
255259 ? "Fork snippet"
256260 : "Save snippet" }
257261 </ Button >
258- { user && user . uid === ownerUid ? (
262+ { uid && user && user . uid === ownerUid ? (
259263 < Button
260264 StartIcon = { ArrowPathIcon }
261265 disabled = { updating }
Original file line number Diff line number Diff line change @@ -47,8 +47,12 @@ const SavedSnippet = () => {
4747 if ( ! router . isReady ) return ;
4848 fetchCodeSnippet ( ) ;
4949 return ( ) => {
50- // set uid to undefined because we are leaving the snippet details page, the only page where uid is required
51- setEditorConfig ( { ...defaultEditorConfig , uid : undefined } ) ;
50+ // set uid & ownerUid to undefined because we are leaving the snippet details page, the only page where uid is required
51+ setEditorConfig ( {
52+ ...defaultEditorConfig ,
53+ uid : undefined ,
54+ ownerUid : undefined ,
55+ } ) ;
5256 } ;
5357 } , [ router . isReady ] ) ;
5458
You can’t perform that action at this time.
0 commit comments