|
|
@@ -1,7 +1,7 @@
|
|
|
import { useThrottleCallback } from '@react-hook/throttle';
|
|
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
|
import { Dispatch, useCallback, useContext, useEffect } from 'react';
|
|
|
-import { LocalAction, stateSet } from '../actions';
|
|
|
+import { LocalAction, songInfoFetched, stateSet } from '../actions';
|
|
|
import { DispatchContext } from '../context/state';
|
|
|
import { NullSong, Song, songExists } from '../types';
|
|
|
import { getApiUrl } from '../utils/url';
|
|
|
@@ -25,7 +25,7 @@ function useNextOrPrevSong(
|
|
|
useEffect(() => {
|
|
|
if (response) {
|
|
|
if (songExists(response)) {
|
|
|
- dispatch(stateSet({ songId: response.id, seekTime: 0, playing: true }));
|
|
|
+ dispatch(songInfoFetched(response, true));
|
|
|
} else {
|
|
|
dispatch(stateSet({ songId: null, playing: false, seekTime: -1 }));
|
|
|
}
|