@@ -90,6 +90,7 @@ export interface State {
9090 shareAllTabs : boolean
9191 shareHttpHeaders : boolean
9292 shareHistory : boolean
93+ changed : boolean
9394}
9495
9596export interface CursorPosition {
@@ -195,6 +196,7 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
195196 shareAllTabs : true ,
196197 shareHttpHeaders : true ,
197198 shareHistory : true ,
199+ changed : false ,
198200 }
199201
200202 if ( typeof window === 'object' ) {
@@ -580,6 +582,7 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
580582 allTabs = { this . state . shareAllTabs }
581583 httpHeaders = { this . state . shareHttpHeaders }
582584 shareUrl = { this . props . shareUrl }
585+ reshare = { this . state . changed }
583586 />
584587 < GraphDocs schema = { this . state . schemaCache } />
585588 { this . state . historyOpen &&
@@ -652,6 +655,7 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
652655 ...state ,
653656 sessions : state . sessions . concat ( session ) ,
654657 selectedSessionIndex : newIndexZero ? 0 : state . sessions . length ,
658+ changed : true ,
655659 }
656660 } )
657661 }
@@ -833,6 +837,7 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
833837 ...state . sessions . slice ( i + 1 , state . sessions . length ) ,
834838 ] ,
835839 selectedSessionIndex : nextSelectedSession ,
840+ changed : true ,
836841 }
837842 } )
838843
@@ -1045,6 +1050,7 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
10451050 return {
10461051 ...state ,
10471052 sessions : Immutable . setIn ( state . sessions , [ i , key ] , value ) ,
1053+ changed : true ,
10481054 }
10491055 } ,
10501056 ( ) => {
@@ -1235,11 +1241,11 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
12351241 }
12361242
12371243 private share = ( ) => {
1238- // noop
12391244 this . saveSessions ( )
12401245 this . saveHistory ( )
12411246 this . storage . saveProject ( )
12421247 this . props . share ( this . storage . project )
1248+ this . setState ( { changed : false } )
12431249 }
12441250}
12451251
0 commit comments