Skip to content

Commit

Permalink
fix: saved decks not being scrolled into view
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Dec 13, 2024
1 parent b0e7536 commit 4dec3e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ private void ListViewDecks_OnSelectionChanged(object sender, SelectionChangedEve
OnSelectedDeckChanged?.Invoke(this, SelectedDecks);
}

public void SelectDeckAndAppropriateView(Deck deck)
public void SelectDeckAndAppropriateView(Deck deck, bool forceUpdate = false)
{
if(deck == null)
return;
Expand Down Expand Up @@ -546,7 +546,7 @@ public void SelectDeckAndAppropriateView(Deck deck)
Core.MainWindow.SortFilterDecksFlyout.SetSelectedTags(Config.Instance.SelectedTags);
}

UpdateDecks(false);
UpdateDecks(false, forceUpdate: forceUpdate ? new[] { deck } : null);
SelectDeck(deck);
var dpi = _displayedDecks.FirstOrDefault(x => Equals(x.Deck, deck));
if(dpi != null)
Expand Down
3 changes: 1 addition & 2 deletions Hearthstone Deck Tracker/DeckManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ public static void SaveDeck(Deck deck, bool invokeApi = true)
deck.Edited();
DeckList.Instance.Decks.Add(deck);
DeckList.Save();
Core.MainWindow.DeckPickerList.SelectDeckAndAppropriateView(deck);
Core.MainWindow.DeckPickerList.UpdateDecks(forceUpdate: new[] { deck });
Core.MainWindow.DeckPickerList.SelectDeckAndAppropriateView(deck, forceUpdate: true);
Core.MainWindow.SelectDeck(deck, true);
if(invokeApi)
DeckManagerEvents.OnDeckCreated.Execute(deck);
Expand Down

0 comments on commit 4dec3e2

Please sign in to comment.