1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-17 21:44:05 +00:00

Made harsh loading/error experience friendlier

This commit is contained in:
2023-06-23 17:22:47 +02:00
parent 964e66e8a3
commit dc0094b27c
21 changed files with 262 additions and 253 deletions

View File

@ -7,18 +7,21 @@
let activePath = [];
let _indexes = [];
let error = '';
async function refresh() {
await collection.getIndexes();
_indexes = collection.indexes.map(idx => {
return {
name: idx.name,
background: idx.background || false,
unique: idx.unique || false,
sparse: idx.sparse || false,
model: idx.model,
};
});
error = await collection.getIndexes();
if (!error) {
_indexes = collection.indexes.map(idx => {
return {
name: idx.name,
background: idx.background || false,
unique: idx.unique || false,
sparse: idx.sparse || false,
model: idx.model,
};
});
}
}
async function createIndex() {
@ -50,6 +53,8 @@
key="name"
data={_indexes}
getRootMenu={(_, idx) => [ { label: 'Drop this index', fn: () => dropIndex(idx.name) } ]}
errorTitle={error ? 'Error while getting indexes' : ''}
errorDescription={error}
bind:activePath
/>
</div>