Skip to content

Commit

Permalink
🛠️: refactor Libraries/LibraryFolder/FolderTopBar to read genomes/d…
Browse files Browse the repository at this point in the history
…bKeys from `dbKeyStore` store
  • Loading branch information
itisAliRH committed Jul 3, 2024
1 parent eeebb1c commit 92fa399
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { BButton, BFormCheckbox } from "bootstrap-vue";
import { storeToRefs } from "pinia";
import { computed, onMounted, ref } from "vue";
import { fetchGenomes } from "@/api/genomes";
import { getGalaxyInstance } from "@/app";
import { Services } from "@/components/Libraries/LibraryFolder/services";
import mod_add_datasets from "@/components/Libraries/LibraryFolder/TopToolbar/add-datasets";
Expand All @@ -16,6 +15,7 @@ import mod_import_collection from "@/components/Libraries/LibraryFolder/TopToolb
import mod_import_dataset from "@/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-dataset";
import { type DetailedDatatypes, useDetailedDatatypes } from "@/composables/datatypes";
import { Toast } from "@/composables/toast";
import { useDbKeyStore } from "@/stores/dbKeyStore";
import { useUserStore } from "@/stores/userStore";
import FolderDetails from "@/components/Libraries/LibraryFolder/FolderDetails/FolderDetails.vue";
Expand Down Expand Up @@ -56,6 +56,8 @@ const { isAdmin } = storeToRefs(userStore);
const { datatypes } = useDetailedDatatypes();
const dbKeyStore = useDbKeyStore();
const libraryImportDir = ref(false);
const allowLibraryPathPaste = ref(false);
const genomesList = ref<GenomesList>([]);
Expand Down Expand Up @@ -225,12 +227,9 @@ async function fetchExtAndGenomes() {
}
try {
const { data: genomes } = await fetchGenomes({});
await dbKeyStore.fetchUploadDbKeys();
genomesList.value = genomes.map((genome: string[]) => ({
id: genome[1] || "",
text: genome[0] || "",
}));
genomesList.value = dbKeyStore.uploadDbKeys;
genomesList.value.sort((a, b) => (a.id > b.id ? 1 : a.id < b.id ? -1 : 0));
} catch (err) {
Expand Down

0 comments on commit 92fa399

Please sign in to comment.