Skip to content

Commit

Permalink
sorting and view bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartondock committed May 26, 2024
1 parent 5ab188b commit 6031d6e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## 2.5.5
### Fixed
* Bug with sorting in list view
* [Issue 666](https://github.com/SteamGridDB/steam-rom-manager/issues/666)

## 2.5.4
### Added
* Ability to put back in exclusions from the add games page.
Expand Down
8 changes: 1 addition & 7 deletions src/renderer/components/preview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,7 @@ export class PreviewComponent implements OnDestroy {
}

sortedAppIds(apps: PreviewDataApps) {
if(this.listSortBy=='extractedTitle') {
return Object.keys(apps).sort((a,b)=>apps[a].extractedTitle.localeCompare(apps[b].title))
} else if(this.listSortBy=='finalTitle') {
return Object.keys(apps).sort((a,b)=>apps[a].title.localeCompare(apps[b].title))
} else if(this.listSortBy=='configurationTitle') {
return Object.keys(apps).sort((a,b)=>apps[a].configurationTitle.localeCompare(apps[b].title))
}
return Object.keys(apps).sort((a,b)=>(apps[a][this.listSortBy as keyof PreviewDataApp] as string).localeCompare(apps[b][this.listSortBy as keyof PreviewDataApp] as string))
}

async exportSelection() {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class ViewComponent {
}

sortedShortcuts(shortcuts: VDF_ShortcutsItem[]) {
return (shortcuts || []).sort((a,b)=>a.appname.localeCompare(b.appname));
return (shortcuts || []).sort((a,b)=>(a.appname||"").localeCompare(b.appname||""));
}

async setCurrentShortcut(steamDir: string, steamUser: string, shortcut: VDF_ShortcutsItem) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/templates/preview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h1>Add your games to Steam</h1>
<ng-container *ngIf="getCurrentViewType()==='list'">
<div class="listItem header">
<div class="infoField" (click)="listSortBy='extractedTitle'" [class.sortBy]="listSortBy=='extractedTitle'"><span>Extracted Title</span></div>
<div class="infoField" (click)="listSortBy='finalTitle'" [class.sortBy]="listSortBy=='finalTitle'"><span>Final Title</span></div>
<div class="infoField" (click)="listSortBy='title'" [class.sortBy]="listSortBy=='title'"><span>Final Title</span></div>
<div class="infoField" (click)="listSortBy='configurationTitle'" [class.sortBy]="listSortBy=='configurationTitle'"><span>Parser</span></div>
</div>
</ng-container>
Expand Down

0 comments on commit 6031d6e

Please sign in to comment.