From f472e0cca648e627c3192d44ed10b2a8ab9b01ab Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 11 Sep 2022 21:59:16 -0500 Subject: [PATCH] setTags: call endpoints synchronously --- app/soapbox/actions/admin.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/soapbox/actions/admin.ts b/app/soapbox/actions/admin.ts index 82f244429..02af5e87a 100644 --- a/app/soapbox/actions/admin.ts +++ b/app/soapbox/actions/admin.ts @@ -422,13 +422,11 @@ const untagUsers = (accountIds: string[], tags: string[]) => /** Synchronizes user tags to the backend. */ const setTags = (accountId: string, oldTags: string[], newTags: string[]) => - (dispatch: AppDispatch) => { + async(dispatch: AppDispatch) => { const diff = getTagDiff(oldTags, newTags); - return Promise.all([ - dispatch(tagUsers([accountId], diff.added)), - dispatch(untagUsers([accountId], diff.removed)), - ]); + await dispatch(tagUsers([accountId], diff.added)); + await dispatch(untagUsers([accountId], diff.removed)); }; /** Synchronizes badges to the backend. */