Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/components/Audioplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class Audioplayer extends Component {
currentAyah: PropTypes.string,
buildOnClient: PropTypes.func.isRequired,
isLoadedOnClient: PropTypes.bool.isRequired,
isSupported: PropTypes.bool.isRequired,
isLoading: PropTypes.bool.isRequired,
play: PropTypes.func.isRequired,
pause: PropTypes.func.isRequired,
Expand Down Expand Up @@ -381,7 +380,6 @@ export class Audioplayer extends Component {
isLoading,
currentAyah,
currentTime,
isSupported,
duration,
surah,
isLoadedOnClient,
Expand All @@ -390,14 +388,6 @@ export class Audioplayer extends Component {
setRepeat // eslint-disable-line no-shadow
} = this.props;

if (!isSupported) {
return (
<li className={`${style.container} ${className}`}>
Your browser does not support this audio.
</li>
);
}

if (isLoading) {
return (
<li className={`${style.container} ${className}`}>
Expand Down Expand Up @@ -458,7 +448,6 @@ const mapStateToProps = (state, ownProps) => ({
currentFile: state.audioplayer.currentFile,
currentAyah: state.audioplayer.currentAyah,
surahId: state.audioplayer.surahId,
isSupported: state.audioplayer.isSupported,
isPlaying: state.audioplayer.isPlaying,
isLoadedOnClient: state.audioplayer.isLoadedOnClient,
isLoading: state.audioplayer.isLoading,
Expand Down
13 changes: 1 addition & 12 deletions src/redux/modules/audioplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const initialState = {
currentAyah: null,
currentWord: null,
currentTime: 0,
isSupported: true,
isPlaying: false,
repeat: {
from: undefined,
Expand Down Expand Up @@ -92,16 +91,6 @@ export default function reducer(state = initialState, action = {}) {
}
case AYAHS_LOAD_SUCCESS: {
debug('reducer:audioplayer', 'AYAHS_LOAD_SUCCESS init');
let currentFile;
const isSupported =
action.result.entities.ayahs[action.result.result[0]] != null;

if (!isSupported) {
return {
...state,
isSupported: false
};
}

const ayahs = action.result.entities.ayahs;
const audioFromHash = __CLIENT__ ? buildAudioFromHash(ayahs, state.userAgent) : ayahs;
Expand All @@ -113,6 +102,7 @@ export default function reducer(state = initialState, action = {}) {

const currentAyah = state.currentAyah ? state.currentAyah : Object.keys(files)[0];

let currentFile;
if (state.currentFile && state.currentFile === Object.values(files)[0]) {
// If the same file is being used, for example in lazy loading, then keep same file
currentFile = state.currentFile;
Expand All @@ -133,7 +123,6 @@ export default function reducer(state = initialState, action = {}) {
debug('reducer:audioplayer', 'AYAHS_LOAD_SUCCESS return');
return {
...state,
isSupported,
currentAyah,
currentFile,
surahId: action.surahId,
Expand Down