@@ -574,6 +576,11 @@ export class SettingsView extends React.Component
{
private getLinkedDeviceSettings(): Array {
const { linkedPubKeys } = this.state;
+ const { isSecondaryDevice } = this.props;
+ // tslint:disable-next-line: no-backbone-get-set-outside-model
+ const noPairedDeviceText = isSecondaryDevice
+ ? window.i18n('deviceIsSecondaryNoPairing')
+ : window.i18n('noPairedDevices');
if (linkedPubKeys && linkedPubKeys.length > 0) {
return linkedPubKeys.map((pubkey: any) => {
@@ -621,7 +628,7 @@ export class SettingsView extends React.Component {
return [
{
id: 'no-linked-device',
- title: window.i18n('noPairedDevices'),
+ title: noPairedDeviceText,
type: undefined,
description: '',
category: SessionSettingCategory.Devices,
diff --git a/ts/components/session/settings/SessionSettingsHeader.tsx b/ts/components/session/settings/SessionSettingsHeader.tsx
index b5dc93df0..453573f44 100644
--- a/ts/components/session/settings/SessionSettingsHeader.tsx
+++ b/ts/components/session/settings/SessionSettingsHeader.tsx
@@ -6,19 +6,18 @@ import { SessionButton } from '../SessionButton';
interface Props extends SettingsViewProps {
showLinkDeviceButton: boolean | null;
- disableLinkDeviceButton: boolean | null;
+ isSecondaryDevice: boolean;
}
export class SettingsHeader extends React.Component {
public static defaultProps = {
showLinkDeviceButton: false,
- disableLinkDeviceButton: true,
};
public constructor(props: any) {
super(props);
this.state = {
- disableLinkDeviceButton: this.props.disableLinkDeviceButton,
+ disableLinkDeviceButton: true,
};
this.showAddLinkedDeviceModal = this.showAddLinkedDeviceModal.bind(this);
}
@@ -32,10 +31,12 @@ export class SettingsHeader extends React.Component {
}
public componentDidMount() {
- window.Whisper.events.on('refreshLinkedDeviceList', async () => {
+ if (!this.props.isSecondaryDevice) {
+ window.Whisper.events.on('refreshLinkedDeviceList', async () => {
+ this.refreshLinkedDevice();
+ });
this.refreshLinkedDevice();
- });
- this.refreshLinkedDevice();
+ }
}
public refreshLinkedDevice() {
@@ -51,7 +52,9 @@ export class SettingsHeader extends React.Component {
}
public componentWillUnmount() {
- window.Whisper.events.off('refreshLinkedDeviceList');
+ if (!this.props.isSecondaryDevice) {
+ window.Whisper.events.off('refreshLinkedDeviceList');
+ }
}
public render() {