Skip to content

Commit

Permalink
feat: limit Battlegrounds session recap to 8 games
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoraes74 committed Aug 20, 2024
1 parent 2dd433c commit d165aaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@
<rect key="frame" x="0.0" y="0.0" width="238" height="28"/>
<middleViews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="f0P-Hk-d1j">
<rect key="frame" x="49" y="6" width="16" height="16"/>
<rect key="frame" x="50" y="6" width="16" height="16"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="tier7-logo" id="Bp6-4v-Gbp"/>
</imageView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="751" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zg8-RK-ENA">
<rect key="frame" x="69" y="6" width="121" height="16"/>
<rect key="frame" x="70" y="6" width="121" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Composition Stats" id="dfB-qF-lgY">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ class BattlegroundsSession: OverWindowController {
deleteOldGames(games: sortedGames)
sessionGames = getSessionGames(sortedGames: sortedGames)
let firstGame = sessionGames.first
if sessionGames.count > 10 {
sessionGames.removeSubrange(0 ..< sessionGames.count - 10)
if sessionGames.count > 8 {
sessionGames.removeSubrange(0 ..< sessionGames.count - 8)
}
sessionGames = sessionGames.sorted(by: { (a, b) in a.startTime > b.startTime })
for subview in lastGames.subviews.reversed() where subview as? BattlegroundsGameView != nil {
Expand Down

0 comments on commit d165aaa

Please sign in to comment.