mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Don't autoplay on next when stoppedFixes #730
This commit is contained in:
parent
28f0f98eb1
commit
dd1f6164d9
2 changed files with 16 additions and 2 deletions
|
|
@ -8,6 +8,7 @@
|
|||
### Bug Fixes:
|
||||
|
||||
- Fix a bug where context menus could appear in the wrong location ([95db2d](https://github.com/captbaritone/webamp/commit/95db2d08b6b189f5b9da577d23aca44b04c462a8))
|
||||
- Fix a bug where pressing next/previous when stopped would play the track ([#740](https://github.com/captbaritone/webamp/issues/730))
|
||||
|
||||
## 1.3.1 [CURRENT]
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
PAUSE,
|
||||
PLAY_TRACK,
|
||||
TOGGLE_TIME_MODE,
|
||||
BUFFER_TRACK,
|
||||
} from "../actionTypes";
|
||||
|
||||
import { MEDIA_STATUS } from "../constants";
|
||||
|
|
@ -31,7 +32,19 @@ function playRandomTrack(): Dispatchable {
|
|||
} while (nextId === currentTrack && trackOrder.length > 1);
|
||||
// TODO: Sigh... Technically, we should detect if we are looping only repeat if we are.
|
||||
// I think this would require pre-computing the "random" order of a playlist.
|
||||
dispatch({ type: PLAY_TRACK, id: nextId });
|
||||
dispatch(playTrack(nextId));
|
||||
};
|
||||
}
|
||||
|
||||
function playTrack(id: number): Dispatchable {
|
||||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
const isStopped = Selectors.getMediaStatus(state) === MEDIA_STATUS.STOPPED;
|
||||
if (isStopped) {
|
||||
dispatch({ type: BUFFER_TRACK, id });
|
||||
} else {
|
||||
dispatch({ type: PLAY_TRACK, id });
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -76,7 +89,7 @@ export function nextN(n: number): Dispatchable {
|
|||
if (nextTrackId == null) {
|
||||
return;
|
||||
}
|
||||
dispatch({ type: PLAY_TRACK, id: nextTrackId });
|
||||
dispatch(playTrack(nextTrackId));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue