From ded5b8641aece51bc05c918af811815a0beee2c6 Mon Sep 17 00:00:00 2001 From: robyngit Date: Thu, 17 Oct 2024 15:08:11 -0400 Subject: [PATCH] Trigger "renderComplete" on showIsPrivate In the MetadataView. This ensures that if the logged in status changes, the view will re-render to show the correct information. Issue #2541 --- src/js/views/MetadataView.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/views/MetadataView.js b/src/js/views/MetadataView.js index 194fe80b4..93ee05c63 100644 --- a/src/js/views/MetadataView.js +++ b/src/js/views/MetadataView.js @@ -427,7 +427,9 @@ define([ }); // Listen to 404 and 401 errors when we get the metadata object + this.stopListening(model, "404"); this.listenToOnce(model, "404", this.showNotFound); + this.stopListening(model, "401"); this.listenToOnce(model, "401", this.showIsPrivate); // Fetch the model @@ -780,6 +782,11 @@ define([ // bit until we show a 401 msg, in case this content is their private // content if (!MetacatUI.appUserModel.get("checked")) { + this.stopListening( + MetacatUI.appUserModel, + "change:checked", + this.showIsPrivate, + ); this.listenToOnce( MetacatUI.appUserModel, "change:checked", @@ -787,6 +794,8 @@ define([ ); return; } + this.isRendering = false; + this.trigger("renderComplete"); let msg = "";