Display spinner animation during loading
This commit is contained in:
1 parent
4871613c67
commit
688811317c
23 files changed
+447
-307
No files matched your search
+9
-5
@@ -93,7 +93,7 @@ function putActionHandler(action, _object): Promise<ValidationErrors> {
|
||||
.resourceExists("files", id)
|
||||
.then((exists) => {
|
||||
if (exists) {
|
||||
store.fulfill(0, Date.now());
|
||||
store.setTimestamp(Date.now());
|
||||
return void resolve({ file: "File already exists" });
|
||||
}
|
||||
const headers = Object.assign(
|
||||
@@ -117,7 +117,7 @@ function putActionHandler(action, _object): Promise<ValidationErrors> {
|
||||
"success",
|
||||
`File ${exists ? "updated" : "created"}`
|
||||
);
|
||||
store.fulfill(0, Date.now());
|
||||
store.setTimestamp(Date.now());
|
||||
resolve();
|
||||
})
|
||||
.catch(reject);
|
||||
@@ -288,11 +288,11 @@ export const component: ClosureComponent = (): Component => {
|
||||
"success",
|
||||
`${res.length} files deleted`
|
||||
);
|
||||
store.fulfill(0, Date.now());
|
||||
store.setTimestamp(Date.now());
|
||||
})
|
||||
.catch((err) => {
|
||||
notifications.push("error", err.message);
|
||||
store.fulfill(0, Date.now());
|
||||
store.setTimestamp(Date.now());
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -310,7 +310,11 @@ export const component: ClosureComponent = (): Component => {
|
||||
return [
|
||||
m("h1", "Listing files"),
|
||||
m(filterComponent, filterAttrs),
|
||||
m(indexTableComponent, attrs),
|
||||
m(
|
||||
"loading",
|
||||
{ queries: [files, count] },
|
||||
m(indexTableComponent, attrs)
|
||||
),
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user