mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 21:51:29 +08:00
use loader to indicate background activity
This commit is contained in:
parent
41ffdfc57a
commit
ed7eaed764
1 changed files with 3 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import * as ServerConfiguration from "../ape/server-configuration";
|
|||
import * as AuthEvent from "../observables/auth-event";
|
||||
import { Connection } from "@monkeytype/schemas/connections";
|
||||
import { Friend } from "@monkeytype/schemas/users";
|
||||
import * as Loader from "../elements/loader";
|
||||
|
||||
const pageElement = $(".page.pageFriends");
|
||||
|
||||
|
|
@ -388,6 +389,7 @@ $(".pageFriends .pendingRequests table").on("click", async (e) => {
|
|||
}
|
||||
row.querySelectorAll("button").forEach((button) => (button.disabled = true));
|
||||
|
||||
Loader.show();
|
||||
const result =
|
||||
action === "rejected"
|
||||
? await Ape.connections.delete({
|
||||
|
|
@ -397,6 +399,7 @@ $(".pageFriends .pendingRequests table").on("click", async (e) => {
|
|||
params: { id },
|
||||
body: { status: action },
|
||||
});
|
||||
Loader.hide();
|
||||
|
||||
if (result.status !== 200) {
|
||||
Notifications.add(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue