mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Properly activate a playlist after creation
This commit is contained in:
parent
1344d23465
commit
ec6cd1bb08
3 changed files with 13 additions and 3 deletions
|
@ -155,6 +155,7 @@
|
|||
if (view === 'favorites') {
|
||||
this.active = this.isFavorites;
|
||||
} else if (view === 'playlist') {
|
||||
console.log(playlist.id, this.playlist.id);
|
||||
this.active = this.playlist === playlist;
|
||||
} else {
|
||||
this.active = false;
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { last } from 'lodash';
|
||||
|
||||
import playlistStore from '../../../stores/playlist';
|
||||
import favoriteStore from '../../../stores/favorite';
|
||||
|
||||
|
@ -55,7 +57,12 @@
|
|||
store() {
|
||||
this.creating = false;
|
||||
|
||||
playlistStore.store(this.newName, [], () => this.newName = '');
|
||||
playlistStore.store(this.newName, [], () => {
|
||||
this.newName = '';
|
||||
this.$nextTick(() => {
|
||||
this.$root.loadPlaylist(last(this.playlistState.playlists));
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -69,8 +69,10 @@
|
|||
playlistStore.store(this.newPlaylistName, this.songs, () => {
|
||||
this.newPlaylistName = '';
|
||||
|
||||
// Activate the new playlist right away
|
||||
this.$root.loadPlaylist(last(this.playlistState.playlists));
|
||||
this.$nextTick(() => {
|
||||
// Activate the new playlist right away
|
||||
this.$root.loadPlaylist(last(this.playlistState.playlists));
|
||||
});
|
||||
});
|
||||
|
||||
this.close();
|
||||
|
|
Loading…
Reference in a new issue