Skip to content

Commit 7602d29

Browse files
committed
Fixed a bug where if a view was already showing and you tried to navigate to it again _prevView is and view are now the same a cannot navigate back.
1 parent 20d9d42 commit 7602d29

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/HyperMC/HyperMcView.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,12 @@ public void SetView(IView view, object? data = null)
228228
{
229229
if (_view is not null)
230230
{
231-
_view.HideView(Utils.PopChildControls(pnl_MainArea));
232-
_view.OnMessage -= View_OnMessage;
233-
_viewPrev = _view;
231+
if (_view.GetType() != view.GetType())
232+
{
233+
_view.HideView(Utils.PopChildControls(pnl_MainArea));
234+
_view.OnMessage -= View_OnMessage;
235+
_viewPrev = _view;
236+
}
234237
}
235238

236239
view.OnMessage += View_OnMessage;

0 commit comments

Comments
 (0)