mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix(permissions): drop the membership request when stepping back
Back only cleared the selected user; it left the membership request in flight and did not advance the request counter, so nothing invalidated it. On rejection the guard still matched, and the error landed on the user step — reporting "Could not load users." over a user list that had loaded fine, with a Retry that re-ran the wrong request. Back now invalidates the in-flight request and clears the error and spinner it owns. The rejection path also checks the selected user, so it matches the success path rather than relying on the counter alone.
This commit is contained in:
1 parent
5c99615902
commit
c354538173
1 file changed
+7
-1
@@ -57,6 +57,12 @@
|
||||
user = null;
|
||||
memberships = undefined;
|
||||
membershipOffset = 0;
|
||||
|
||||
// Stepping back abandons the membership request. Leaving it live lets its rejection
|
||||
// land on the user step and report the user list as the thing that failed.
|
||||
latestRequest++;
|
||||
loadError = '';
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
function reset() {
|
||||
@@ -113,7 +119,7 @@
|
||||
if (requestId !== latestRequest || user?.$id !== requestedUserId) return;
|
||||
memberships = response;
|
||||
} catch (error) {
|
||||
if (requestId !== latestRequest) return;
|
||||
if (requestId !== latestRequest || user?.$id !== requestedUserId) return;
|
||||
loadError = error.message;
|
||||
addNotification({ type: 'error', message: error.message });
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user