Skip to content

Commit b18c7ad

Browse files
committed
Fix incorrect loading spinner on the Lists UI. Closes #1822.
1 parent d1c964d commit b18c7ad

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

frontend/src/api/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const queryLists = (params) => http.get(
127127
'/api/lists',
128128
{
129129
params: (!params ? { per_page: 'all' } : params),
130-
loading: models.lists,
130+
loading: models.listsFull,
131131
},
132132
);
133133

frontend/src/constants.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ export const models = Object.freeze({
22
serverConfig: 'serverConfig',
33
lang: 'lang',
44
dashboard: 'dashboard',
5+
// This loading state is used across all contexts where lists are loaded
6+
// via the instant "minimal" API.
57
lists: 'lists',
8+
// This is used only on the lists page where lists are loaded with full
9+
// context (subscriber counts), which can be slow and expensive.
10+
listsFull: 'listsFull',
611
subscribers: 'subscribers',
712
campaigns: 'campaigns',
813
templates: 'templates',

frontend/src/views/Lists.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717
</header>
1818

19-
<b-table :data="lists.results" :loading="loading.lists" hoverable default-sort="createdAt" paginated
19+
<b-table :data="lists.results" :loading="loading.listsFull" hoverable default-sort="createdAt" paginated
2020
backend-pagination pagination-position="both" @page-change="onPageChange" :current-page="queryParams.page"
2121
:per-page="lists.perPage" :total="lists.total" backend-sorting @sort="onSort">
2222
<template #top-left>
@@ -142,7 +142,7 @@
142142
</div>
143143
</b-table-column>
144144

145-
<template #empty v-if="!loading.lists">
145+
<template #empty v-if="!loading.listsFull">
146146
<empty-placeholder />
147147
</template>
148148
</b-table>

0 commit comments

Comments
 (0)