Skip to content

Commit

Permalink
Trigger "renderComplete" on showIsPrivate
Browse files Browse the repository at this point in the history
In the MetadataView. This ensures that if the logged in status changes, the view will re-render to show the correct information.

Issue #2541
  • Loading branch information
robyngit committed Oct 17, 2024
1 parent 270324e commit 029f128
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/views/MetadataView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -780,13 +782,20 @@ 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",
this.showIsPrivate,
);
return;
}
this.isRendering = false;
this.trigger("renderComplete");

let msg = "";

Expand Down

0 comments on commit 029f128

Please sign in to comment.