Skip to content

Commit

Permalink
Fix twitch chat roles not getting added and updated properly in the v…
Browse files Browse the repository at this point in the history
…iewer database

Addresses #2798
  • Loading branch information
CaveMobster committed Sep 26, 2024
1 parent c8406cf commit cbedb02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/backend/chat/chat-listeners/active-user-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,13 @@ exports.addOnlineUser = async (viewer) => {
return;
}

const roles = await chatRolesManager.getUsersChatRoles(twitchUser.id);

const userDetails = {
id: twitchUser.id,
username: twitchUser.name,
displayName: twitchUser.displayName,
twitchRoles: [],
twitchRoles: roles,
profilePicUrl: twitchUser.profilePictureUrl,
disableViewerList: false
};
Expand Down
5 changes: 1 addition & 4 deletions src/gui/app/directives/modals/viewers/viewerDetailsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,12 @@
return;
}

const relationshipData = $ctrl.viewerDetails.twitchData.relationship;
const channelRoles = relationshipData ? relationshipData.roles : [];

const createViewerRequest = {
id: $ctrl.resolve.userId,
username: $ctrl.viewerDetails.twitchData.username,
displayName: $ctrl.viewerDetails.twitchData.displayName,
profilePicUrl: $ctrl.viewerDetails.twitchData.profilePicUrl,
twitchRoles: channelRoles
twitchRoles: $ctrl.viewerDetails.twitchData.userRoles
};

$q((resolve) => {
Expand Down

0 comments on commit cbedb02

Please sign in to comment.