lbry-desktop/ui/modal/modalAnnouncements/index.js
infinite-persistence 3719a73c81
Add announcement modal and open it after prefs sync'd.
- Don't want to show it in Incognito.
- Only show it in when entered from homepage, or in the Help page.
- Record the hash of the viewed announcement and update the wallet with it.
2022-05-20 00:04:06 +08:00

20 lines
724 B
JavaScript

import ModalAnnouncements from './view';
import { connect } from 'react-redux';
import { doHideModal } from 'redux/actions/app';
import { doSetLastViewedAnnouncement } from 'redux/actions/content';
import { selectLastViewedAnnouncement } from 'redux/selectors/content';
import { selectHomepageAnnouncement } from 'redux/selectors/settings';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
const select = (state) => ({
authenticated: selectUserVerifiedEmail(state),
announcement: selectHomepageAnnouncement(state),
lastViewedHash: selectLastViewedAnnouncement(state),
});
const perform = {
doHideModal,
doSetLastViewedAnnouncement,
};
export default connect(select, perform)(ModalAnnouncements);