From 9464c038060c83884d90cd0ba91b90a6aab4c7d6 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 30 Jul 2020 15:53:44 +1000 Subject: [PATCH] adress reviews --- _locales/en/messages.json | 4 ++-- ts/components/session/ActionsPanel.tsx | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 0eec9ab2a..3140bc0f0 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1327,11 +1327,11 @@ "description": "Description of why multi device is disabled on app start" }, "multiDeviceDisabledTemporaryDescriptionPrimary": { - "message": "You’re seeing this because you have a secondary device linked to your Session ID. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality on August 6th. Device linking has been disabled, and the next update will erase existing secondary devices.

To read more about this change, visit the Session FAQ at getsession.org/faq", + "message": "You’re seeing this because you have a secondary device linked to your Session ID. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on August 6th.

To read more about this change, visit the Session FAQ at getsession.org/faq.", "description": "Description of why multi device is disabled on app start for a primary device" }, "multiDeviceDisabledTemporaryDescriptionSecondary": { - "message": "You’re seeing this because this is a secondary device in a multi-device setup. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality on August 6th. Device linking has been disabled, and the next update will erase existing secondary devices.
To read more about this change, visit the Session FAQ at getsession.org/faq", + "message": "You’re seeing this because this is a secondary device in a multi-device setup. To improve reliability and stability, we’ve decided to temporarily disable Session’s multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on August 6th.

To read more about this change, visit the Session FAQ at getsession.org/faq.", "description": "Description of why multi device is disabled on app start for a secondary device" }, "messageTTL": { diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 29b299fc7..067abaa8d 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -3,6 +3,7 @@ import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; import { Avatar } from '../Avatar'; import { PropsData as ConversationListItemPropsType } from '../ConversationListItem'; import { MultiDeviceProtocol } from '../../session/protocols'; +import { UserUtil } from '../../util'; export enum SectionType { Profile, @@ -58,14 +59,18 @@ export class ActionsPanel extends React.Component { 'refreshAvatarCallback' ); setTimeout(async () => { + 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 = - !window.textsecure.storage.get('isSecondaryDevice') && + !isSecondary && hasMultipleDevices; - const isSecondary = !!window.textsecure.storage.get( - 'isSecondaryDevice' - ); if (!primaryWithSecondary && !isSecondary) { return;