{
},
'refreshAvatarCallback'
);
+ setTimeout(async () => {
+ const disabledMultiDeviceCountDb = await getItemById(
+ 'disabledMultiDeviceCount'
+ );
+ const disabledMultiDeviceCount =
+ Number(disabledMultiDeviceCountDb?.value) || 0;
+ const data = {
+ id: 'disabledMultiDeviceCount',
+ value: String(disabledMultiDeviceCount + 1),
+ };
+ await createOrUpdateItem(data);
+ if (disabledMultiDeviceCount % 5 !== 0) {
+ return;
+ }
+ const currentDevice = await UserUtil.getCurrentDevicePubKey();
+ if (!currentDevice) {
+ return;
+ }
+ const secondaryDevices = await MultiDeviceProtocol.getSecondaryDevices(
+ currentDevice
+ );
+ const isSecondary =
+ secondaryDevices.find(s => s.key === currentDevice) ||
+ !!window.textsecure.storage.get('isSecondaryDevice');
+
+ const hasMultipleDevices =
+ (await MultiDeviceProtocol.getOurDevices()).length > 1;
+ const primaryWithSecondary = !isSecondary && hasMultipleDevices;
+
+ if (!primaryWithSecondary && !isSecondary) {
+ return;
+ }
+
+ const opts = {
+ hideCancel: true,
+ title: window.i18n('multiDeviceDisabledTemporaryTitle'),
+ message: primaryWithSecondary
+ ? window.i18n('multiDeviceDisabledTemporaryDescriptionPrimary')
+ : window.i18n('multiDeviceDisabledTemporaryDescriptionSecondary'),
+ };
+ window.Whisper.events.trigger('showConfirmationDialog', opts);
+ }, 1000);
}
);
}
diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx
index be7d733ea..4690a3d34 100644
--- a/ts/components/session/RegistrationTabs.tsx
+++ b/ts/components/session/RegistrationTabs.tsx
@@ -557,8 +557,9 @@ export class RegistrationTabs extends React.Component<{}, State> {
SessionButtonType.BrandOutline,
SessionButtonColor.Green
)}
- {or}
- {this.renderLinkDeviceToExistingAccountButton()}
+ {/*{or}
*/}
+ {/* FIXME enable back to allow linking of device
+ this.renderLinkDeviceToExistingAccountButton() */}
);
}
@@ -583,8 +584,9 @@ export class RegistrationTabs extends React.Component<{}, State> {
return (
{this.renderContinueYourSessionButton()}
-
{or}
- {this.renderLinkDeviceToExistingAccountButton()}
+ {/*{or}
*/}
+ {/* FIXME enable back to allow linking of device
+ this.renderLinkDeviceToExistingAccountButton()*/}
);
}
diff --git a/ts/components/session/SessionConfirm.tsx b/ts/components/session/SessionConfirm.tsx
index 859e856c8..ed8914c4a 100644
--- a/ts/components/session/SessionConfirm.tsx
+++ b/ts/components/session/SessionConfirm.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import { SessionModal } from './SessionModal';
import { SessionButton, SessionButtonColor } from './SessionButton';
+import { SessionHtmlRenderer } from './SessionHTMLRenderer';
interface Props {
message: string;
@@ -61,7 +62,11 @@ export class SessionConfirm extends React.Component {
{!showHeader && }
-
{message}
+
{messageSub && (
{messageSub}
diff --git a/ts/components/session/SessionHTMLRenderer.tsx b/ts/components/session/SessionHTMLRenderer.tsx
index f7f493b7b..438213be5 100644
--- a/ts/components/session/SessionHTMLRenderer.tsx
+++ b/ts/components/session/SessionHTMLRenderer.tsx
@@ -5,6 +5,7 @@ interface ReceivedProps {
html: string;
tag?: string;
key?: any;
+ className?: string;
}
// Needed because of https://github.com/microsoft/tslint-microsoft-contrib/issues/339
@@ -14,14 +15,16 @@ export const SessionHtmlRenderer: React.SFC = ({
tag = 'div',
key,
html,
+ className,
}) => {
const clean = DOMPurify.sanitize(html, {
USE_PROFILES: { html: true },
- FORBID_ATTR: ['style', 'script'],
+ FORBID_ATTR: ['script'],
});
return React.createElement(tag, {
key,
+ className,
dangerouslySetInnerHTML: { __html: clean },
});
};
diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx
index 3b4076da0..f60459ea8 100644
--- a/ts/components/session/settings/SessionSettings.tsx
+++ b/ts/components/session/settings/SessionSettings.tsx
@@ -644,7 +644,7 @@ export class SettingsView extends React.Component {
id: 'no-linked-device',
title: noPairedDeviceText,
type: undefined,
- description: '',
+ description: window.i18n('multiDeviceDisabledTemporary'),
category: SessionSettingCategory.Devices,
content: {},
comparisonValue: undefined,
diff --git a/ts/components/session/settings/SessionSettingsHeader.tsx b/ts/components/session/settings/SessionSettingsHeader.tsx
index 21e663e96..b1e33393a 100644
--- a/ts/components/session/settings/SessionSettingsHeader.tsx
+++ b/ts/components/session/settings/SessionSettingsHeader.tsx
@@ -74,9 +74,12 @@ export class SettingsHeader extends React.Component {
? `${categoryTitlePrefix.slice(0, -1)} Settings`
: `${categoryTitlePrefix} Settings`;
const showSearch = false;
- const showAddDevice =
+ const showAddDevice = false;
+ /* FIXME enable back to allow linking of device
+ const showAddDevice =
category === SessionSettingCategory.Devices &&
this.props.showLinkDeviceButton;
+ */
return (