This commit is contained in:
Audric Ackermann 2020-07-30 15:03:08 +10:00
parent abc9456d14
commit 761ebf4a7c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
4 changed files with 35 additions and 21 deletions

View File

@ -90,7 +90,14 @@
type: 'success',
});
},
showConfirmationDialog({ title, message, messageSub, onOk, onCancel, hideCancel }) {
showConfirmationDialog({
title,
message,
messageSub,
onOk,
onCancel,
hideCancel,
}) {
window.confirmationDialog({
title,
message,

View File

@ -57,26 +57,29 @@ export class ActionsPanel extends React.Component<Props, State> {
},
'refreshAvatarCallback'
);
setTimeout(
async () => {
const hasMultipleDevices = (await MultiDeviceProtocol.getOurDevices()).length > 1;
const primaryWithSecondary = !window.textsecure.storage.get('isSecondaryDevice') && hasMultipleDevices;
const isSecondary = !!window.textsecure.storage.get('isSecondaryDevice');
setTimeout(async () => {
const hasMultipleDevices =
(await MultiDeviceProtocol.getOurDevices()).length > 1;
const primaryWithSecondary =
!window.textsecure.storage.get('isSecondaryDevice') &&
hasMultipleDevices;
const isSecondary = !!window.textsecure.storage.get(
'isSecondaryDevice'
);
if (!primaryWithSecondary && !isSecondary) {
return;
}
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
);
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

@ -584,7 +584,7 @@ export class RegistrationTabs extends React.Component<{}, State> {
return (
<div>
{this.renderContinueYourSessionButton()}
{/*<h4>{or}</h4>*/}
{/*<h4>{or}</h4>*/}
{/* FIXME enable back to allow linking of device
this.renderLinkDeviceToExistingAccountButton()*/}
</div>

View File

@ -62,7 +62,11 @@ export class SessionConfirm extends React.Component<Props> {
{!showHeader && <div className="spacer-lg" />}
<div className="session-modal__centered">
<SessionHtmlRenderer tag="span" className={messageSubText} html={message} />
<SessionHtmlRenderer
tag="span"
className={messageSubText}
html={message}
/>
{messageSub && (
<span className="session-confirm-sub-message subtle">
{messageSub}