Remove multi-device warnings

This commit is contained in:
Mikunj 2020-08-04 12:45:12 +10:00
parent 49b994367d
commit 22c64395d9
3 changed files with 3 additions and 54 deletions

View File

@ -1306,18 +1306,6 @@
"message": "MultiDevice disabled temporarily",
"description": "Description of why multi device is disabled"
},
"multiDeviceDisabledTemporaryTitle": {
"message": "Changes to Multi-device",
"description": "Description of why multi device is disabled on app start"
},
"multiDeviceDisabledTemporaryDescriptionPrimary": {
"message": "Youre seeing this because you have a secondary device linked to your Session ID. To improve reliability and stability, weve decided to temporarily disable Sessions multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on <span style=\"color:#00f782\">August 6th</span>.</br></br>To read more about this change, visit the Session FAQ at <a href=\"https://getsession.org/faq\">getsession.org/faq</a>.",
"description": "Description of why multi device is disabled on app start for a primary device"
},
"multiDeviceDisabledTemporaryDescriptionSecondary": {
"message": "Youre seeing this because this is a secondary device in a multi-device setup. To improve reliability and stability, weve decided to temporarily disable Sessions multi-device functionality. Device linking has been disabled, and existing secondary clients will be erased on <span style=\"color:#00f782\">August 6th</span>.</br></br>To read more about this change, visit the Session FAQ at <a href=\"https://getsession.org/faq\">getsession.org/faq</a>.",
"description": "Description of why multi device is disabled on app start for a secondary device"
},
"messageTTL": {
"message": "Message TTL",
"description": "Title of the Message TTL setting"

View File

@ -59,48 +59,6 @@ export class ActionsPanel extends React.Component<Props, State> {
},
'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);
}
);
}

View File

@ -88,6 +88,9 @@ export async function handlePairingAuthorisationMessage(
dataMessage: SignalService.IDataMessage | undefined | null
): Promise<void> {
if (!window.lokiFeatureFlags.useMultiDevice) {
window.log.info(
`Received a pairing authorisation message from ${envelope.source} while multi device is disabled.`
);
await removeFromCache(envelope);
return;
}