mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
Toast on device pairing request received but in device pairing mode
This commit is contained in:
parent
a6e54d5c52
commit
b3d895caf3
|
@ -987,6 +987,13 @@
|
|||
"devicePairingReceived": {
|
||||
"message": "Device Pairing Received"
|
||||
},
|
||||
"devicePairingRequestReceivedNoListenerTitle": {
|
||||
"message": "Device pairing request received."
|
||||
},
|
||||
"devicePairingRequestReceivedNoListenerDescription": {
|
||||
"message":
|
||||
"Device pairing request received but you are not on the device pairing screen. \nFirst go to Settings -> Device -> Link New Device."
|
||||
},
|
||||
"waitingForDeviceToRegister": {
|
||||
"message": "Waiting for device to register..."
|
||||
},
|
||||
|
|
|
@ -1340,6 +1340,18 @@
|
|||
}
|
||||
});
|
||||
|
||||
Whisper.events.on('devicePairingRequestReceivedNoListener', async () => {
|
||||
window.pushToast({
|
||||
title: window.i18n('devicePairingRequestReceivedNoListenerTitle'),
|
||||
description: window.i18n(
|
||||
'devicePairingRequestReceivedNoListenerDescription'
|
||||
),
|
||||
type: 'info',
|
||||
id: 'pairingRequestNoListener',
|
||||
shouldFade: false,
|
||||
});
|
||||
});
|
||||
|
||||
Whisper.events.on('devicePairingRequestAccepted', async (pubKey, cb) => {
|
||||
try {
|
||||
await getAccountManager().authoriseSecondaryDevice(pubKey);
|
||||
|
|
|
@ -977,6 +977,11 @@ MessageReceiver.prototype.extend({
|
|||
'devicePairingRequestReceived',
|
||||
pairingRequest.secondaryDevicePubKey
|
||||
);
|
||||
} else {
|
||||
Whisper.events.trigger(
|
||||
'devicePairingRequestReceivedNoListener',
|
||||
pairingRequest.secondaryDevicePubKey
|
||||
);
|
||||
}
|
||||
// Ignore requests if the dialog is closed
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue