Skip to content

Commit

Permalink
fix(ui): do not load graph if never displayed (fix #1602) (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
MPeloquin committed Jul 26, 2022
1 parent 0dd07ab commit 7b0e4c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ui/client/components/FileDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { ModuleGraphData } from '#types'
const data = ref<ModuleGraphData>({ externalized: [], graph: {}, inlined: [] })
const graph = ref<ModuleGraph>({ nodes: [], links: [] })
const draft = ref(false)
const hasGraphBeenDisplayed = ref(false)
debouncedWatch(
current,
Expand All @@ -28,6 +29,9 @@ const open = () => {
}
const changeViewMode = (view: Params['view']) => {
if (view === 'graph')
hasGraphBeenDisplayed.value = true
viewMode.value = view
}
const consoleCount = computed(() => {
Expand Down Expand Up @@ -89,7 +93,9 @@ function onDraft(value: boolean) {
</div>

<div flex flex-col flex-1 overflow="hidden">
<ViewModuleGraph v-show="viewMode === 'graph'" :graph="graph" />
<div v-if="hasGraphBeenDisplayed" flex-1>
<ViewModuleGraph v-show="viewMode === 'graph'" :graph="graph" />
</div>
<ViewEditor v-if="viewMode === 'editor'" :key="current.filepath" :file="current" @draft="onDraft" />
<ViewConsoleOutput v-else-if="viewMode === 'console'" :file="current" />
<ViewReport v-else-if="!viewMode" :file="current" />
Expand Down

0 comments on commit 7b0e4c9

Please sign in to comment.