From b75b02c5a25e096e942b4e854e773ad28d180998 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Tue, 4 Aug 2020 16:06:18 +1000 Subject: [PATCH] Hide multi device UI if flag is not set --- _locales/en/messages.json | 4 ---- .../session/LeftPaneSettingSection.tsx | 2 +- ts/components/session/RegistrationTabs.tsx | 18 ++++++++++++------ .../session/settings/SessionSettings.tsx | 2 +- .../session/settings/SessionSettingsHeader.tsx | 5 +---- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0e015833f..cbc2489a9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1302,10 +1302,6 @@ "message": "Typing Indicators", "description": "Title of the typing indicators setting" }, - "multiDeviceDisabledTemporary": { - "message": "MultiDevice disabled temporarily", - "description": "Description of why multi device is disabled" - }, "messageTTL": { "message": "Message TTL", "description": "Title of the Message TTL setting" diff --git a/ts/components/session/LeftPaneSettingSection.tsx b/ts/components/session/LeftPaneSettingSection.tsx index 7d729e498..cecb27ad8 100644 --- a/ts/components/session/LeftPaneSettingSection.tsx +++ b/ts/components/session/LeftPaneSettingSection.tsx @@ -225,7 +225,7 @@ export class LeftPaneSettingSection extends React.Component { { id: SessionSettingCategory.Devices, title: window.i18n('devicesSettingsTitle'), - hidden: isSecondaryDevice, + hidden: !window.lokiFeatureFlags.useMultiDevice || isSecondaryDevice, }, ]; } diff --git a/ts/components/session/RegistrationTabs.tsx b/ts/components/session/RegistrationTabs.tsx index 4690a3d34..71fa3aac7 100644 --- a/ts/components/session/RegistrationTabs.tsx +++ b/ts/components/session/RegistrationTabs.tsx @@ -557,9 +557,12 @@ export class RegistrationTabs extends React.Component<{}, State> { SessionButtonType.BrandOutline, SessionButtonColor.Green )} - {/*

{or}

*/} - {/* FIXME enable back to allow linking of device - this.renderLinkDeviceToExistingAccountButton() */} + {window.lokiFeatureFlags.useMultiDevice && ( + <> +

{or}

+ {this.renderLinkDeviceToExistingAccountButton()} + + )} ); } @@ -584,9 +587,12 @@ export class RegistrationTabs extends React.Component<{}, State> { return (
{this.renderContinueYourSessionButton()} - {/*

{or}

*/} - {/* FIXME enable back to allow linking of device - this.renderLinkDeviceToExistingAccountButton()*/} + {window.lokiFeatureFlags.useMultiDevice && ( + <> +

{or}

+ {this.renderLinkDeviceToExistingAccountButton()} + + )}
); } diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index f60459ea8..3b4076da0 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: window.i18n('multiDeviceDisabledTemporary'), + description: '', category: SessionSettingCategory.Devices, content: {}, comparisonValue: undefined, diff --git a/ts/components/session/settings/SessionSettingsHeader.tsx b/ts/components/session/settings/SessionSettingsHeader.tsx index b1e33393a..21e663e96 100644 --- a/ts/components/session/settings/SessionSettingsHeader.tsx +++ b/ts/components/session/settings/SessionSettingsHeader.tsx @@ -74,12 +74,9 @@ export class SettingsHeader extends React.Component { ? `${categoryTitlePrefix.slice(0, -1)} Settings` : `${categoryTitlePrefix} Settings`; const showSearch = false; - const showAddDevice = false; - /* FIXME enable back to allow linking of device - const showAddDevice = + const showAddDevice = category === SessionSettingCategory.Devices && this.props.showLinkDeviceButton; - */ return (