Skip to content

Commit

Permalink
Add special case for dev latest (microsoft#3912)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits authored Oct 23, 2024
1 parent 551a1ee commit 8cbfb61
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ document.addEventListener('DOMContentLoaded', function() {
if (preferred) {
// Get current rendered version
const currentVersion = DOCUMENTATION_OPTIONS.VERSION;
const urlVersionPath = DOCUMENTATION_OPTIONS.theme_switcher_version_match;
// The version compare library seems to not like the dev suffix without - so we're going to do an exact match and hide the banner if so
if (currentVersion === preferred.version) {
// For the "dev" version which is always latest we don't want to consider hiding the banner
if ((currentVersion === preferred.version) && (urlVersionPath !== "dev")) {
// Hide the banner with id bd-header-version-warning
document.getElementById('bd-header-version-warning').style.display = 'none';
return;
Expand Down

0 comments on commit 8cbfb61

Please sign in to comment.