Преглед изворни кода

Don't try to load menu if we have an error page (fix cyclical error condition)

Robert Marshall пре 3 година
родитељ
комит
96edbfe454
1 измењених фајлова са 14 додато и 12 уклоњено
  1. 14 12
      src/Website/Views/Shared/_Layout.cshtml

+ 14 - 12
src/Website/Views/Shared/_Layout.cshtml

@@ -29,18 +29,20 @@
 		<h1>@ViewData["Title"]</h1>
 		@RenderBody()
 	</main>
-	<nav>
-		<label for="menu-toggle"></label>
-		<input type="checkbox" id="menu-toggle" />
-		<div class="nav-container">
-			@await Component.InvokeAsync("BlogNavigation")
-			@await Component.InvokeAsync("ProjectNavigation")
-		</div>
-		<div class="strava">
-			<iframe height="160" width="250" frameborder="0" allowtransparency="true" scrolling="no" src="https://www.strava.com/athletes/8892667/activity-summary/df1a6e21a9947dbe7a9dd36f86b1c17185002d22"></iframe>
-			<iframe height="454" width="250" frameborder="0" allowtransparency="true" scrolling="no" src="https://www.strava.com/athletes/8892667/latest-rides/df1a6e21a9947dbe7a9dd36f86b1c17185002d22"></iframe>
-		</div>
-	</nav>
+	@if (Model?.GetType() != typeof(ErrorViewModel)) {
+		<nav>
+			<label for="menu-toggle"></label>
+			<input type="checkbox" id="menu-toggle"/>
+			<div class="nav-container">
+				@await Component.InvokeAsync("BlogNavigation")
+				@await Component.InvokeAsync("ProjectNavigation")
+			</div>
+			<div class="strava">
+				<iframe height="160" width="250" frameborder="0" allowtransparency="true" scrolling="no" src="https://www.strava.com/athletes/8892667/activity-summary/df1a6e21a9947dbe7a9dd36f86b1c17185002d22"></iframe>
+				<iframe height="454" width="250" frameborder="0" allowtransparency="true" scrolling="no" src="https://www.strava.com/athletes/8892667/latest-rides/df1a6e21a9947dbe7a9dd36f86b1c17185002d22"></iframe>
+			</div>
+		</nav>
+	}
 </div>
 <footer>
 	<div class="logo" onclick="window.location='/account'"></div>