Follow track change when toggle
This commit is contained in:
parent
cc301da971
commit
69ddfd48e9
3 changed files with 18 additions and 5 deletions
|
|
@ -14,6 +14,12 @@
|
|||
import { getTrack } from '$lib/track';
|
||||
import { tracks } from '$lib/stores/tracks';
|
||||
|
||||
function toggleEnable(track) {
|
||||
track.toggleEnable().then((t) => {
|
||||
tracks.refresh();
|
||||
goto('musiks/tracks/' + t.id);
|
||||
})
|
||||
}
|
||||
function deleteThis(track) {
|
||||
track.delete().then(() => {
|
||||
tracks.refresh();
|
||||
|
|
@ -38,7 +44,7 @@
|
|||
</ListGroupItem>
|
||||
<ListGroupItem class="d-flex gap-2">
|
||||
<strong>Active ?</strong>
|
||||
<Input type="switch" on:change={() => track.toggleEnable()} checked={track.enabled} />
|
||||
<Input type="switch" on:change={() => toggleEnable(track)} checked={track.enabled} />
|
||||
</ListGroupItem>
|
||||
<ListGroupItem>
|
||||
<strong>ID</strong>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue