X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3f809e0be2a712d1e576f1b2acf4aff73e0f16b0..25216cc7acedc987c26a159f0b640210c0ef101e:/src/views-components/sharing-dialog/sharing-public-access-form.tsx

diff --git a/src/views-components/sharing-dialog/sharing-public-access-form.tsx b/src/views-components/sharing-dialog/sharing-public-access-form.tsx
index bf64ba32..2a216b04 100644
--- a/src/views-components/sharing-dialog/sharing-public-access-form.tsx
+++ b/src/views-components/sharing-dialog/sharing-public-access-form.tsx
@@ -3,17 +3,21 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { reduxForm } from 'redux-form';
-import { connect } from 'react-redux';
 import { compose } from 'redux';
+import { connect } from 'react-redux';
 import SharingPublicAccessFormComponent from './sharing-public-access-form-component';
-import { SHARING_PUBLIC_ACCESS_FORM_NAME } from '~/store/sharing-dialog/sharing-dialog-types';
-import { PermissionLevel } from '~/models/permission';
+import { SHARING_PUBLIC_ACCESS_FORM_NAME } from 'store/sharing-dialog/sharing-dialog-types';
+import { RootState } from 'store/store';
+import { getSharingPublicAccessFormData } from '../../store/sharing-dialog/sharing-dialog-types';
+
 export const SharingPublicAccessForm = compose(
-    connect(() => ({
-        initialValues: {
-            enabled: false,
-            permissions: PermissionLevel.CAN_READ,
+    reduxForm(
+        { form: SHARING_PUBLIC_ACCESS_FORM_NAME }
+    ),
+    connect(
+        (state: RootState) => {
+            const { visibility } = getSharingPublicAccessFormData(state);
+            return { visibility };
         }
-    })),
-    reduxForm({ form: SHARING_PUBLIC_ACCESS_FORM_NAME })
-)(SharingPublicAccessFormComponent);
\ No newline at end of file
+    )
+)(SharingPublicAccessFormComponent);
