Skip to content
Snippets Groups Projects
Commit 14926560 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix: download directive correct check of mode & only check if big brain is selected

parent 161f7546
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ import { MatSnackBar } from 'src/sharedModules/angularMaterial.exports'
import { Store, select } from '@ngrx/store';
import { Subject, concat, of } from 'rxjs';
import { distinctUntilChanged, shareReplay, take } from 'rxjs/operators';
import { SAPI } from 'src/atlasComponents/sapi';
import { IDS, SAPI } from 'src/atlasComponents/sapi';
import { MainState, userInteraction, userInterface } from 'src/state';
import { fromRootStore, selectors } from "src/state/atlasSelection"
import { wait } from "src/util/fn"
......@@ -18,17 +18,7 @@ export class AtlasDownloadDirective {
@HostListener('click')
async onClick(){
try {
const mode = await this.store.pipe(
select(userInterface.selectors.panelMode),
take(1)
).toPromise()
if (mode !== "FOUR_PANEL") {
await this.dialogSvc.getUserConfirm({
markdown: `Download current view only works in \`four panel\` mode. \n\nContinue the download - as if \`four panel\` view was active?`,
})
}
this.#busy$.next(true)
const { parcellation, template } = await this.store.pipe(
fromRootStore.distinctATP(),
......@@ -60,6 +50,23 @@ export class AtlasDownloadDirective {
space_id: template.id,
}
if (template.id === IDS.TEMPLATES.BIG_BRAIN) {
const mode = await this.store.pipe(
select(userInterface.selectors.panelMode),
take(1)
).toPromise()
/**
* default value of mode is null
*/
if (mode && mode !== "FOUR_PANEL") {
await this.dialogSvc.getUserConfirm({
markdown: `Download current view only works in \`four panel\` mode. \n\nContinue the download - as if \`four panel\` view was active?`,
})
}
}
if (bbox) {
query['bbox'] = JSON.stringify([bbox.minpoint, bbox.maxpoint])
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment