From 66515e79247bfba0caee85567846c8820f885a6c Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Fri, 22 Sep 2023 10:02:00 +0200 Subject: [PATCH 1/2] Fix refreshing of course members page after actions --- app/views/courses/_reload_users.js.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/courses/_reload_users.js.erb b/app/views/courses/_reload_users.js.erb index 2b7e7bb3f7..b57420df9f 100644 --- a/app/views/courses/_reload_users.js.erb +++ b/app/views/courses/_reload_users.js.erb @@ -3,5 +3,7 @@ new dodona.Toast("<%= toast %>"); <% end %> <% count = @course.pending_members.count %> -document.getElementById("pending-count").innerText = "<%= count if count.nonzero? %>"; +if(document.getElementById("pending-count")) { + document.getElementById("pending-count").innerText = "<%= count if count.nonzero? %>"; +} dodona.search.search(); From 06b9b60a3ea9ed8fe78197e4ae5b050595a5ccbe Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Fri, 22 Sep 2023 10:38:14 +0200 Subject: [PATCH 2/2] Update app/views/courses/_reload_users.js.erb Co-authored-by: Charlotte Van Petegem --- app/views/courses/_reload_users.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/courses/_reload_users.js.erb b/app/views/courses/_reload_users.js.erb index b57420df9f..45751d5cd3 100644 --- a/app/views/courses/_reload_users.js.erb +++ b/app/views/courses/_reload_users.js.erb @@ -3,7 +3,7 @@ new dodona.Toast("<%= toast %>"); <% end %> <% count = @course.pending_members.count %> -if(document.getElementById("pending-count")) { +if (document.getElementById("pending-count")) { document.getElementById("pending-count").innerText = "<%= count if count.nonzero? %>"; } dodona.search.search();