Skip to content

Commit

Permalink
bug fix, spread and sort
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-jadhav committed Dec 6, 2022
1 parent 1a2c12b commit e304ce2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"url": "git+https://github.com/roundware/roundware-web-framework.git"
},
"version": "0.12.8-alpha.13",
"version": "0.12.8-alpha.14",
"description": "Client framework for Roundware, a location-based contributory audio platform",
"main": "dist/roundware.js",
"files": [
Expand Down
5 changes: 4 additions & 1 deletion src/listenHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class ListenHistory {
constructor() {
// load earlier history from indexedDB
localforage.getItem<IAssetData>(`listenHistory`).then((assets) => {
if (Array.isArray(assets)) this.assets = [...assets, this.assets];
if (Array.isArray(assets))
this.assets = [...assets, ...this.assets].sort(
(a, b) => b.addedAt! - a.addedAt!
);
});
}

Expand Down

0 comments on commit e304ce2

Please sign in to comment.