Skip to content

Commit

Permalink
Merge pull request galaxyproject#18550 from mvdbeek/datatypesMapper_fix
Browse files Browse the repository at this point in the history
[24.1] Simplify and fix `useDatatypesMapper`
  • Loading branch information
davelopez authored Jul 17, 2024
2 parents dc0ffcd + 38859d9 commit 13871de
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions client/src/composables/datatypesMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,11 @@ export function useDatatypesMapper() {
const datatypes: Ref<string[]> = ref([]);

async function getDatatypesMapper() {
try {
await datatypesMapperStore.createMapper();
datatypesMapper.value = datatypesMapperStore.datatypesMapper;
if (datatypesMapperStore.datatypesMapper) {
datatypes.value = datatypesMapperStore.datatypesMapper.datatypes;
}
} catch (e) {
console.error("unable to create datatypes mapper\n", e);
} finally {
datatypesMapperLoading.value = false;
}
if (!datatypesMapperStore.datatypesMapper) {
throw Error("Error creating datatypesMapper");
await datatypesMapperStore.createMapper();
datatypesMapperLoading.value = datatypesMapperStore.loading;
datatypesMapper.value = datatypesMapperStore.datatypesMapper;
if (datatypesMapperStore.datatypesMapper) {
datatypes.value = datatypesMapperStore.datatypesMapper.datatypes;
}
}

Expand Down

0 comments on commit 13871de

Please sign in to comment.