Implement file remove dialogs
[arvados-workbench2.git] / src / store / dialog / with-dialog.ts
index e42cd5b4c3a9e982e422f90c504aa064d171ae9a..d53a79d6efe19f5ccde771f05d1590bd77199f0e 100644 (file)
@@ -10,7 +10,7 @@ import { dialogActions } from './dialog-actions';
 
 export type WithDialogStateProps<T> = {
     open: boolean;
-    data?: T;
+    data: T;
 };
 
 export type WithDialogDispatchProps = {
@@ -25,7 +25,7 @@ export const withDialog = (id: string) =>
 
 export const mapStateToProps = (id: string) => <T>(state: { dialog: DialogState }): WithDialogStateProps<T> => {
     const dialog = state.dialog[id];
-    return dialog ? dialog : { open: false };
+    return dialog ? dialog : { open: false, data: {} };
 };
 
 export const mapDispatchToProps = (id: string) => (dispatch: Dispatch): WithDialogDispatchProps => ({