fix: use window.RenameProjectModal via React.createElement
RenameProjectModal is exported to window from screens-projects.jsx, so Library screen must reference it via window object and use React.createElement instead of JSX syntax.
This commit is contained in:
parent
d94ed00312
commit
0ebc7ef777
1 changed files with 7 additions and 7 deletions
|
|
@ -373,11 +373,11 @@ function Library({ navigate, onOpenAsset, openProject, onClearProject }) {
|
|||
onRename={function(p) { setProjectCtx(null); setRenamingProject(p); }}
|
||||
/>
|
||||
)}
|
||||
{renamingProject && (
|
||||
<RenameProjectModal
|
||||
project={renamingProject}
|
||||
onClose={function() { setRenamingProject(null); }}
|
||||
onSaved={function() {
|
||||
{renamingProject && window.RenameProjectModal && (
|
||||
React.createElement(window.RenameProjectModal, {
|
||||
project: renamingProject,
|
||||
onClose: function() { setRenamingProject(null); },
|
||||
onSaved: function() {
|
||||
setRenamingProject(null);
|
||||
// Re-fetch projects and update ZAMPP_DATA so the rail refreshes
|
||||
window.ZAMPP_API.fetch('/projects').then(function(list) {
|
||||
|
|
@ -395,8 +395,8 @@ function Library({ navigate, onOpenAsset, openProject, onClearProject }) {
|
|||
setProjVersion(function(v) { return v + 1; });
|
||||
}
|
||||
}).catch(function() {});
|
||||
}}
|
||||
/>
|
||||
}
|
||||
})
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue