Set pause status on last track end (#291)

This commit is contained in:
jeffvli 2023-10-23 09:02:48 -07:00
parent ccfadda729
commit fdff79496a
2 changed files with 8 additions and 1 deletions

View file

@ -261,6 +261,13 @@ export const usePlayerStore = create<PlayerSlice>()(
});
}
if (isLastTrack && repeat === PlayerRepeat.NONE) {
set((state) => {
state.current.time = 0;
state.current.status = PlayerStatus.PAUSED;
});
}
return get().actions.getPlayerData();
},
checkIsFirstTrack: () => {