File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ class Gist extends Component {
155155 if ( updateGistStatus . succeeded ) {
156156 const prevGistUpdateStatus = getStatus ( { gists } , `gists.meta.${ gistId } .updateStatus` ) ;
157157 if ( prevGistUpdateStatus . pending ) {
158- setTimeout ( ( ) => resetUpdateGistStatus ( gistId ) , 1500 ) ;
158+ this . resettingUpdate = setTimeout ( ( ) => resetUpdateGistStatus ( gistId ) , 1500 ) ;
159159 }
160160 }
161161 }
@@ -186,6 +186,13 @@ class Gist extends Component {
186186 const { gistId, updateGist } = this . props ;
187187 const { description, files } = this . state ;
188188
189+ // We may have a timer already set to "reset" the
190+ // state of the update request if a previous request
191+ // succeeded. If that is the case, we need to end the
192+ // timer.
193+ // For more, see `componentDidUpdate`
194+ clearTimeout ( this . resettingUpdate ) ;
195+
189196 updateGist ( gistId , {
190197 description,
191198 files
You can’t perform that action at this time.
0 commit comments