FIX: Refactor both dialogs to get common code
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
dd29287c5a
commit
ed64716f0f
@@ -161,15 +161,13 @@ function App() {
|
||||
>
|
||||
<TemplatesDialog
|
||||
onClose={() => setTemplatesDialogOpen(false)}
|
||||
onSelectTemplate={
|
||||
async (fileName) => {
|
||||
const model_bytes = await get_documentation_model(fileName);
|
||||
const importedModel = Model.from_bytes(model_bytes);
|
||||
saveModelToStorage(importedModel);
|
||||
setModel(importedModel);
|
||||
setTemplatesDialogOpen(false);
|
||||
}
|
||||
}
|
||||
onSelectTemplate={async (fileName) => {
|
||||
const model_bytes = await get_documentation_model(fileName);
|
||||
const importedModel = Model.from_bytes(model_bytes);
|
||||
saveModelToStorage(importedModel);
|
||||
setModel(importedModel);
|
||||
setTemplatesDialogOpen(false);
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
</Wrapper>
|
||||
|
||||
Reference in New Issue
Block a user