Skip to content

Commit

Permalink
more usage of dialogContext in FileDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas committed Jan 9, 2025
1 parent 6590237 commit f28583c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions viewer/components/FileDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const getDownloadUrl=(item)=>{
}

const showConvertFunctions = {
track: (history,item) => {
track: (dialogContext,history,item) => {
TrackConvertDialog.showDialog(history,item.name);
}
}
Expand Down Expand Up @@ -759,11 +759,9 @@ export const FileDialogWithActions=(props)=>{
}
if (action === 'userapp'){
if (item.url) {
showPromiseDialog(undefined, (props) =>
<UserAppDialog {...props} fixed={{url: item.url}}/>
)
.then((data) => doneAction())
.catch((error) => doneAction());
dialogContext.replaceDialog((props) =>
<UserAppDialog {...props} fixed={{url: item.url}} resolveFunction={()=>{}}/>
,()=>doneAction())
}
}
if (action === 'delete'){
Expand All @@ -789,7 +787,7 @@ export const FileDialogWithActions=(props)=>{
if ( action === 'convert'){
let convertFunction=showConvertFunctions[newItem.type];
if (convertFunction){
convertFunction(history,newItem);
convertFunction(dialogContext,history,newItem);
}
return;
}
Expand Down
2 changes: 1 addition & 1 deletion viewer/components/UserAppDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ const UserAppDialog = (props) => {
UserAppDialog.propTypes = {
fixed: PropTypes.object.isRequired,
addon: PropTypes.object,
resolveFunction: PropTypes.func
resolveFunction: PropTypes.func.isRequired
};

export default UserAppDialog;

0 comments on commit f28583c

Please sign in to comment.