File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,6 @@ const props = defineProps<{
1111const chartModal = useModal (' chart-modal' )
1212
1313const isChartModalOpen = shallowRef (false )
14- async function openChartModal() {
15- if (! hasWeeklyDownloads .value ) return
16-
17- isChartModalOpen .value = true
18- // ensure the component renders before opening the dialog
19- await nextTick ()
20- await nextTick ()
21- chartModal .open ()
22- }
2314
2415const { fetchPackageDownloadEvolution } = useCharts ()
2516
@@ -87,9 +78,19 @@ const pulseColor = computed(() => {
8778})
8879
8980const weeklyDownloads = shallowRef <WeeklyDownloadPoint []>([])
90- const isLoadingWeeklyDownloads = shallowRef (false )
81+ const isLoadingWeeklyDownloads = shallowRef (true )
9182const hasWeeklyDownloads = computed (() => weeklyDownloads .value .length > 0 )
9283
84+ async function openChartModal() {
85+ if (! hasWeeklyDownloads .value ) return
86+
87+ isChartModalOpen .value = true
88+ // ensure the component renders before opening the dialog
89+ await nextTick ()
90+ await nextTick ()
91+ chartModal .open ()
92+ }
93+
9394async function loadWeeklyDownloads() {
9495 if (! import .meta .client ) return
9596
You can’t perform that action at this time.
0 commit comments