Skip to content

Commit 5a6a6a9

Browse files
authored
Discord groups bug fixes (#764)
bug fixes Profile loading showing with login button Add me and Remove Me not working in production Handle render function deleting non existing element case
1 parent 16d4f1b commit 5a6a6a9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

groups/render.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const renderNavbarProfileSignin = () => {
4848
const removeLoadingNavbarProfile = () => {
4949
const profileEl = document.querySelector('.navbar__profile');
5050
const profileLoadingEl = profileEl.querySelector('.profile--loading');
51+
52+
if (!profileLoadingEl) return;
5153
profileEl.removeChild(profileLoadingEl);
5254
};
5355

groups/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ const onCreate = () => {
140140
console.error(err);
141141
})
142142
.finally(() => {
143+
removeLoadingNavbarProfile();
143144
removeLoadingCards();
144145
});
145146

@@ -246,7 +247,7 @@ function renderAllGroups({ cardOnClick }) {
246247
dataStore.filteredGroupsIds.forEach((id) =>
247248
renderGroupById({
248249
group: dataStore.groups[id],
249-
cardOnClick,
250+
cardOnClick: () => cardOnClick(id),
250251
}),
251252
);
252253
}

0 commit comments

Comments
 (0)