File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ export default class SwaggerUI extends React.Component {
4646 }
4747
4848 componentDidUpdate ( prevProps ) {
49- if ( this . props . url !== prevProps . url ) {
49+ const prevStateUrl = this . system . specSelectors . url ( )
50+ if ( this . props . url !== prevStateUrl || this . props . url !== prevProps . url ) {
5051 // flush current content
5152 this . system . specActions . updateSpec ( "" )
5253
@@ -58,7 +59,8 @@ export default class SwaggerUI extends React.Component {
5859 }
5960 }
6061
61- if ( this . props . spec !== prevProps . spec && this . props . spec ) {
62+ const prevStateSpec = this . system . specSelectors . specStr ( )
63+ if ( this . props . spec && ( this . props . spec !== prevStateSpec || this . props . spec !== prevProps . spec ) ) {
6264 if ( typeof this . props . spec === "object" ) {
6365 this . system . specActions . updateSpec ( JSON . stringify ( this . props . spec ) )
6466 } else {
You can’t perform that action at this time.
0 commit comments