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';
|
|
|
|
import { hasNetworkDialog } from '../selectors/network';
|
2021-10-12 23:59:08 +00:00
|
|
|
import type { WidthBreakpoint } from '../../components/_util';
|
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,
|
|
|
|
hasNetworkDialog: hasNetworkDialog(state),
|
|
|
|
i18n: getIntl(state),
|
2021-11-11 22:46:16 +00:00
|
|
|
currentVersion: window.getVersion(),
|
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);
|