fix sorting recent stations
This commit is contained in:
parent
7d963e18fd
commit
f550f19ce9
@ -2,6 +2,7 @@
|
||||
### Fixed
|
||||
- Set user agent http header for remote API
|
||||
[221](https://git.project-insanity.org/onny/nextcloud-app-radio/-/issues/221) @onny
|
||||
- Update favorite and recent categories without page reload
|
||||
|
||||
### Changed
|
||||
- Update npm modules
|
||||
@ -12,6 +13,8 @@
|
||||
[236](https://git.project-insanity.org/onny/nextcloud-app-radio/-/issues/236) @onny
|
||||
- Create seperate store modules for player, favorites and recent
|
||||
[239](https://git.project-insanity.org/onny/nextcloud-app-radio/-/issues/239) @onny
|
||||
- Put player and api logic into seperate classes
|
||||
[233](https://git.project-insanity.org/onny/nextcloud-app-radio/-/issues/233) @onny
|
||||
|
||||
## 1.0.1 - 2020-12
|
||||
### Added
|
||||
|
@ -33,18 +33,23 @@ export default {
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
|
||||
addRecent(state, station) {
|
||||
state.recent.push(station)
|
||||
},
|
||||
removeRecent(state, station) {
|
||||
const existingIndex = state.recent.findIndex(_station => _station.id === station.id)
|
||||
|
||||
// Remove station from list if already exists
|
||||
const existingIndex = state.recent.findIndex(_station => _station.stationuuid === station.stationuuid)
|
||||
if (existingIndex !== -1) {
|
||||
state.recent.splice(existingIndex, 1)
|
||||
}
|
||||
// Append station at the begging of the list
|
||||
state.recent.unshift(station)
|
||||
|
||||
},
|
||||
|
||||
setRecent(state, stations) {
|
||||
state.recent = stations
|
||||
},
|
||||
|
||||
},
|
||||
actions: {
|
||||
async loadRecent({ commit }) {
|
||||
|
Loading…
Reference in New Issue
Block a user