Skip to content

Commit bd4e26a

Browse files
Katia Arestikaresti
authored andcommitted
[#643] Refresh schema list on delete
1 parent cc64012 commit bd4e26a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/app/ProtoSchema/ProtobufSchemasDisplay.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ const ProtobufSchemasDisplay = (props: { setProtoSchemasCount: (number) => void;
9696
status: t('schemas.status')
9797
};
9898

99+
useEffect(() => {
100+
if (props.isVisible) {
101+
reload();
102+
}
103+
}, [props.isVisible]);
104+
99105
useEffect(() => {
100106
if (schemas) {
101107
props.setProtoSchemasCount(schemas.length);
@@ -145,11 +151,6 @@ const ProtobufSchemasDisplay = (props: { setProtoSchemasCount: (number) => void;
145151
setEditSchemaName('');
146152
};
147153

148-
const closeDeleteSchemaModal = () => {
149-
setDeleteSchemaName('');
150-
reload();
151-
};
152-
153154
const submitEditSchemaModal = () => {
154155
setEditSchemaName('');
155156
reload();
@@ -286,7 +287,7 @@ const ProtobufSchemasDisplay = (props: { setProtoSchemasCount: (number) => void;
286287
>
287288
<Thead>
288289
<Tr>
289-
<Th />
290+
<Th screenReaderText={'expand button'}></Th>
290291
<Th width={30}>{columnNames.name}</Th>
291292
<Th width={60}>{columnNames.status}</Th>
292293
</Tr>
@@ -368,7 +369,10 @@ const ProtobufSchemasDisplay = (props: { setProtoSchemasCount: (number) => void;
368369
<DeleteSchema
369370
schemaName={deleteSchemaName}
370371
isModalOpen={deleteSchemaName !== ''}
371-
closeModal={closeDeleteSchemaModal}
372+
closeModal={() => {
373+
setDeleteSchemaName('');
374+
reload();
375+
}}
372376
/>
373377
</React.Fragment>
374378
);

0 commit comments

Comments
 (0)