mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Try to fetch extensions in constructor of Preview
This commit is contained in:
parent
5dfbe422d7
commit
2293eebaec
1 changed files with 4 additions and 3 deletions
|
@ -55,6 +55,7 @@ class Preview extends React.Component {
|
|||
waiting: false
|
||||
}
|
||||
};
|
||||
this.getExtensions(this.state.projectId);
|
||||
this.addEventListeners();
|
||||
}
|
||||
componentDidUpdate (prevProps) {
|
||||
|
@ -124,9 +125,9 @@ class Preview extends React.Component {
|
|||
}
|
||||
const extensionSet = new Set();
|
||||
if (projectData[0].targets) {
|
||||
projectData[0].targets.forEach(target => target.extensions.forEach(extension => {
|
||||
extensionSet.add(EXTENSION_INFO[extension]);
|
||||
}));
|
||||
projectData[0].targets.forEach(target => target.extensions.forEach(extension => {
|
||||
extensionSet.add(EXTENSION_INFO[extension]);
|
||||
}));
|
||||
}
|
||||
this.setState({
|
||||
extensions: Array.from(extensionSet)
|
||||
|
|
Loading…
Reference in a new issue