|
|
|
@ -29,9 +29,18 @@ |
|
|
|
$: { |
|
|
|
if ($views.selected?.name?.startsWith("all_")) { |
|
|
|
loading = true |
|
|
|
const loadingTableId = $tables.selected?._id |
|
|
|
api.fetchDataForView($views.selected).then(rows => { |
|
|
|
data = rows || [] |
|
|
|
loading = false |
|
|
|
|
|
|
|
// If we started a slow request then quickly change table, sometimes |
|
|
|
// the old data overwrites the new data. |
|
|
|
// This check ensures that we don't do that. |
|
|
|
if (loadingTableId !== $tables.selected?._id) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
data = rows || [] |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|