Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bust cache when loading current API
When starting from scratch, if you go to the admin panel, set the first
API to display, and switch back to the APIs page, it's now out of date
with what's server-side.
  • Loading branch information
amazon-meaisiah committed Jun 22, 2020
commit 6107223f8b701a81c16b5ef5d39f6f22525564fe
8 changes: 4 additions & 4 deletions dev-portal/src/pages/Apis.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export default observer(class ApisPage extends React.Component {
containerRef = React.createRef()
hasRoot = false

componentDidMount () { this.updateApi() }
componentDidUpdate () { this.updateApi() }
componentDidMount () { this.updateApi(true) }
componentDidUpdate () { this.updateApi(false) }
componentWillUnmount () { this.containerRef = null }

updateApi () {
return getApi(this.props.match.params.apiId || 'ANY', true, this.props.match.params.stage)
updateApi (isInitial) {
return getApi(this.props.match.params.apiId || 'ANY', true, this.props.match.params.stage, isInitial)
.then(api => {
if (this.containerRef == null) return
const elem = this.containerRef.current
Expand Down