Skip to content

Commit

Permalink
Merge pull request #525 from dandi/django-file-browser
Browse files Browse the repository at this point in the history
Handle DJANGO_API when rendering the correct file browser
  • Loading branch information
dchiquito committed Dec 14, 2020
2 parents ca87a5e + 0947f38 commit 337c8a8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions web/src/views/FileBrowserView/FileBrowser.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<v-progress-linear
v-if="!girderDandiset"
v-if="!girderDandiset && !publishDandiset"
indeterminate
/>
<PublishFileBrowser
v-else-if="version !== draftVersion"
v-else-if="DJANGO_API"
:identifier="identifier"
:version="version"
/>
Expand All @@ -20,6 +20,7 @@ import { mapState, mapActions } from 'vuex';
import { draftVersion } from '@/utils';
import GirderFileBrowser from './GirderFileBrowser.vue';
import PublishFileBrowser from './PublishFileBrowser.vue';
import toggles from '@/featureToggle';
export default {
name: 'FileBrowser',
Expand Down Expand Up @@ -49,13 +50,15 @@ export default {
// Don't extract girderDandiset or publishDandiset, for reactivity
const { identifier, version } = this;
if (!this.girderDandiset) {
// Await so we can use this value afterwards
await this.fetchGirderDandiset({ identifier });
}
if (!this.publishDandiset && version !== draftVersion) {
this.fetchPublishDandiset({ identifier, version, girderId: this.girderDandiset._id });
if (toggles.DJANGO_API) {
if (!this.publishDandiset) {
this.fetchPublishDandiset({ identifier, version });
}
} else {
if (!this.girderDandiset) {
// Await so we can use this value afterwards
await this.fetchGirderDandiset({ identifier });
}
}
},
methods: {
Expand Down

0 comments on commit 337c8a8

Please sign in to comment.