Skip to content

Commit 433ed3a

Browse files
committed
Fixed bug where navigation was inversed prevented
1 parent 2c25f1c commit 433ed3a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/LinkDotNet.Blog.Web/Features/Admin/BlogPostEditor/Components/CreateNewBlogPost.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136

137137
var isConfirmed = await JSRuntime.InvokeAsync<bool>("confirm", "You have unsaved changes. Are you sure you want to continue?");
138138

139-
if (isConfirmed)
139+
if (!isConfirmed)
140140
{
141141
context.PreventNavigation();
142142
}

tests/LinkDotNet.Blog.UnitTests/Web/Features/Admin/BlogPostEditor/Components/CreateNewBlogPostTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public void ShouldStopExternalNavigationWhenDirty()
183183
public void ShouldStopInternalNavigationWhenDirty()
184184
{
185185
JSInterop.Setup<bool>("confirm", "You have unsaved changes. Are you sure you want to continue?")
186-
.SetResult(true);
186+
.SetResult(false);
187187
var cut = RenderComponent<CreateNewBlogPost>();
188188
cut.Find("#tags").Change("Hey");
189189
var fakeNavigationManager = Services.GetRequiredService<FakeNavigationManager>();

0 commit comments

Comments
 (0)