fix: floating promises and fork usage on login saga (#5589)

This commit is contained in:
Diego Mello 2024-02-23 08:53:14 -03:00 committed by GitHub
parent 65660f530a
commit fb9c271fa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View File

@ -146,6 +146,8 @@ export function getCustomEmojis() {
if (changedEmojis) {
setCustomEmojis();
}
return resolve();
} catch (e) {
log(e);
return resolve();

View File

@ -70,6 +70,7 @@ export function getSlashCommands() {
return allRecords.length;
});
}
return resolve();
} catch (e) {
log(e);
return resolve();

View File

@ -168,10 +168,6 @@ const fetchEnterpriseModulesFork = function* fetchEnterpriseModulesFork({ user }
}
};
const fetchRoomsFork = function* fetchRoomsFork() {
yield put(roomsRequest());
};
const fetchUsersRoles = function* fetchRoomsFork() {
const roles = yield Services.getUsersRoles();
if (roles.length) {
@ -184,7 +180,7 @@ const handleLoginSuccess = function* handleLoginSuccess({ user }) {
getUserPresence(user.id);
const server = yield select(getServer);
yield fork(fetchRoomsFork);
yield put(roomsRequest());
yield fork(fetchPermissionsFork);
yield fork(fetchCustomEmojisFork);
yield fork(fetchRolesFork);