2021-06-29 19:58:29 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { mapDispatchToProps } from '../actions';
|
2023-02-24 23:18:57 +00:00
|
|
|
import { VoiceNotesPlaybackProvider } from '../../components/VoiceNotesPlaybackContext';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { StateType } from '../reducer';
|
2021-06-29 19:58:29 +00:00
|
|
|
import { getSelectedConversationId } from '../selectors/conversations';
|
2023-02-24 23:18:57 +00:00
|
|
|
import { isPaused } from '../selectors/audioPlayer';
|
2021-06-29 19:58:29 +00:00
|
|
|
|
|
|
|
const mapStateToProps = (state: StateType) => {
|
|
|
|
return {
|
|
|
|
conversationId: getSelectedConversationId(state),
|
|
|
|
isPaused: isPaused(state),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
2023-02-24 23:18:57 +00:00
|
|
|
export const SmartVoiceNotesPlaybackProvider = smart(
|
|
|
|
VoiceNotesPlaybackProvider
|
|
|
|
);
|