Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

use getSelectedDate selector

Ed Plato4c2afea8072d
diff --git a/web/js/containers/share.js b/web/js/containers/share.js
index 71503404b..e10741e46 100644
--- a/web/js/containers/share.js
+++ b/web/js/containers/share.js
@@ -13,6 +13,7 @@ import ShareLinks from '../components/toolbar/share/links';
import ShareToolTips from '../components/toolbar/share/tooltips';
import { encode, getSharelink, openPromisedSocial } from '../modules/link/util';
import { serializeDate } from '../modules/date/util';
+import getSelectedDate from '../modules/date/selectors';
import Checkbox from '../components/util/checkbox';
import { requestShortLink } from '../modules/link/actions';
import history from '../main';
@@ -223,18 +224,11 @@ class ShareLinkContainer extends Component {
}
function mapStateToProps(state) {
- const { compare, config, date } = state;
- const { active, isCompareA } = compare;
- const { selected, selectedB } = date;
-
- // selectedDate for shared permalink
- const selectedDate = !active && !isCompareA
- ? selectedB
- : selected;
+ const { config } = state;
return {
shortLink: state.shortLink,
- selectedDate,
+ selectedDate: getSelectedDate(state),
mock:
config.parameters && config.parameters.shorten
? config.parameters.shorten