2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-02-12 21:30:58 +00:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { mapDispatchToProps } from '../actions';
|
2021-08-19 22:56:29 +00:00
|
|
|
import { DialogUpdate } from '../../components/DialogUpdate';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { StateType } from '../reducer';
|
2020-02-12 21:30:58 +00:00
|
|
|
import { getIntl } from '../selectors/user';
|
2023-01-18 23:31:10 +00:00
|
|
|
import { getExpirationTimestamp } from '../selectors/expiration';
|
2021-10-12 23:59:08 +00:00
|
|
|
import type { WidthBreakpoint } from '../../components/_util';
|
2023-01-18 23:31:10 +00:00
|
|
|
import { getName as getOSName } from '../../OS';
|
2020-02-12 21:30:58 +00:00
|
|
|
|
2021-10-12 23:59:08 +00:00
|
|
|
type PropsType = Readonly<{ containerWidthBreakpoint: WidthBreakpoint }>;
|
|
|
|
|
|
|
|
const mapStateToProps = (state: StateType, ownProps: PropsType) => {
|
2020-02-12 21:30:58 +00:00
|
|
|
return {
|
|
|
|
...state.updates,
|
|
|
|
i18n: getIntl(state),
|
2021-11-11 22:46:16 +00:00
|
|
|
currentVersion: window.getVersion(),
|
2023-01-18 23:31:10 +00:00
|
|
|
expirationTimestamp: getExpirationTimestamp(state),
|
|
|
|
OS: getOSName(),
|
2021-10-12 23:59:08 +00:00
|
|
|
...ownProps,
|
2020-02-12 21:30:58 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
2021-08-19 22:56:29 +00:00
|
|
|
export const SmartUpdateDialog = smart(DialogUpdate);
|