Skip to content

Commit

Permalink
change param to isGermline
Browse files Browse the repository at this point in the history
  • Loading branch information
bprize15 committed Nov 7, 2024
1 parent b888680 commit f31b3a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/webapp/app/pages/curation/GeneListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const GeneListPage = (props: IGeneListPage) => {
event.preventDefault();
if (props.firebaseDb) {
try {
await createGeneIfDoesNotExist(cell.value, !isGermline, props.firebaseDb, props.createGene);
await createGeneIfDoesNotExist(cell.value, isGermline, props.firebaseDb, props.createGene);
window.location.href = link;
} catch (error) {
notifyError(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function SomaticGermlineToggleButton({ hugoSymbol, firebaseDb, createGene }: ISo
if (hugoSymbol && createGene) {
// On curation page
try {
await createGeneIfDoesNotExist(hugoSymbol, newVariantType === 'somatic', firebaseDb, createGene);
await createGeneIfDoesNotExist(hugoSymbol, newVariantType === 'germline', firebaseDb, createGene);
} catch (error) {
notifyError(error);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/app/shared/util/firebase/firebase-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -966,13 +966,13 @@ export function isStringEmpty(string: string | undefined | null) {

export async function createGeneIfDoesNotExist(
hugoSymbol: string,
isSomatic: boolean,
isGermline: boolean,
firebaseDb: Database,
createGene: typeof FirebaseGeneService.prototype.createGene,
) {
const genePath = getFirebasePath(isSomatic ? 'GENE' : 'GERMLINE_GENE', hugoSymbol);
const genePath = getFirebasePath(isGermline ? 'GERMLINE_GENE' : 'GENE', hugoSymbol);
const snapshot = await get(ref(firebaseDb, genePath));
if (!snapshot.exists()) {
await createGene?.(hugoSymbol, !isSomatic);
await createGene?.(hugoSymbol, isGermline);
}
}

0 comments on commit f31b3a3

Please sign in to comment.