Skip to content

Commit

Permalink
Fixed recent game count for width screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Oct 14, 2023
1 parent ae3a6b5 commit e71cf06
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/webapp/src/modules/game-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ export class MGameListElement extends GemElement {

#favSet = new Set(store.favoriteIds);

get #length() {
return innerWidth > 1024 ? 5 : 4;
}

get #data() {
if (this.new) {
return store.gameIds?.slice(store.gameIds.length - 4).reverse();
return store.gameIds?.slice(store.gameIds.length - this.#length).reverse();
} else if (this.recent) {
return store.recentGameIds?.slice(0, 4);
return store.recentGameIds?.slice(0, this.#length);
} else if (this.favorite) {
return store.favoriteIds;
} else {
Expand Down

0 comments on commit e71cf06

Please sign in to comment.