From 029f128b1f10c7c7ec6fb2d2c210a05ce5ce2680 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..e4b6c671d 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.stopListeningTo( + 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 = "";