From 4cc63b25801b9470dc3f136fcf05456eb8bc65a1 Mon Sep 17 00:00:00 2001 From: jelveh Date: Mon, 18 Nov 2024 11:29:15 -0800 Subject: [PATCH] Update UIWindowShare.js --- src/gui/src/UI/UIWindowShare.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/UIWindowShare.js b/src/gui/src/UI/UIWindowShare.js index c31dc433c..59e190ef4 100644 --- a/src/gui/src/UI/UIWindowShare.js +++ b/src/gui/src/UI/UIWindowShare.js @@ -369,6 +369,9 @@ $(document).on('click', '.remove-permission-link', async function(){ let recipient_username = $(this).attr('data-recipient-username'); let permission = $(this).attr('data-permission'); + // remove from list. do this first so the user doesn't have to wait for the server + $('.item-perm-recipient-card[data-recipient-username="'+recipient_username+'"][data-permission="'+permission+'"]').remove(); + fetch(puter.APIOrigin + "/auth/revoke-user-user", { "headers": { "Content-Type": "application/json", @@ -380,7 +383,6 @@ $(document).on('click', '.remove-permission-link', async function(){ }), "method": "POST" }).then((response) => { - $('.item-perm-recipient-card[data-permission="'+permission+'"]').remove(); }).catch((err) => { console.error(err); })