mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-24 20:07:51 +00:00
case
This commit is contained in:
parent
4d570068ef
commit
cbd372bc07
File diff suppressed because it is too large
Load Diff
@ -40,6 +40,7 @@ import {
|
||||
clearAllNotificationsCase,
|
||||
createGroupCase,
|
||||
decryptWalletCase,
|
||||
encryptAndPublishSymmetricKeyGroupChatCase,
|
||||
getApiKeyCase,
|
||||
getCustomNodesFromStorageCase,
|
||||
getDataPublishesCase,
|
||||
@ -1660,7 +1661,7 @@ async function sendChat({ qortAddress, recipientPublicKey, message }) {
|
||||
return _response;
|
||||
}
|
||||
|
||||
async function sendChatGroup({
|
||||
export async function sendChatGroup({
|
||||
groupId,
|
||||
typeMessage,
|
||||
chatReference,
|
||||
@ -1991,7 +1992,7 @@ async function createBuyOrderTx({ crosschainAtInfo, useLocal }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function sendChatNotification(
|
||||
export async function sendChatNotification(
|
||||
res,
|
||||
groupId,
|
||||
secretKeyObject,
|
||||
@ -3032,11 +3033,14 @@ function setupMessageListener() {
|
||||
case "getGroupDataSingle":
|
||||
getGroupDataSingleCase(request, event);
|
||||
break;
|
||||
case "getTimestampEnterChat":
|
||||
getTimestampEnterChatCase(request, event);
|
||||
break;
|
||||
case "getGroupNotificationTimestamp":
|
||||
getGroupNotificationTimestampCase(request, event);
|
||||
case "getTimestampEnterChat":
|
||||
getTimestampEnterChatCase(request, event);
|
||||
break;
|
||||
case "getGroupNotificationTimestamp":
|
||||
getGroupNotificationTimestampCase(request, event);
|
||||
break;
|
||||
case "encryptAndPublishSymmetricKeyGroupChat":
|
||||
encryptAndPublishSymmetricKeyGroupChatCase(request, event);
|
||||
break;
|
||||
default:
|
||||
console.error("Unknown action:", request.action);
|
||||
|
@ -107,28 +107,36 @@ export const CreateCommonSecret = ({groupId, secretKey, isOwner, myAddress, sec
|
||||
const secretKeyToSend = !secretKey2 ? null : secretKey2
|
||||
|
||||
|
||||
chrome?.runtime?.sendMessage({ action: "encryptAndPublishSymmetricKeyGroupChat", payload: {
|
||||
groupId: groupId,
|
||||
previousData: secretKeyToSend
|
||||
} }, (response) => {
|
||||
if (!response?.error) {
|
||||
setInfoSnack({
|
||||
type: "success",
|
||||
message: "Successfully re-encrypted secret key. It may take a couple of minutes for the changes to propagate. Refresh the group in 5mins",
|
||||
});
|
||||
setOpenSnack(true);
|
||||
setTxList((prev)=> [{
|
||||
window.sendMessage("encryptAndPublishSymmetricKeyGroupChat", {
|
||||
groupId: groupId,
|
||||
previousData: secretKeyToSend,
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response?.error) {
|
||||
setInfoSnack({
|
||||
type: "success",
|
||||
message: "Successfully re-encrypted secret key. It may take a couple of minutes for the changes to propagate. Refresh the group in 5 mins.",
|
||||
});
|
||||
setOpenSnack(true);
|
||||
setTxList((prev) => [
|
||||
{
|
||||
...response,
|
||||
type: 'created-common-secret',
|
||||
label: `Published secret key for group ${groupId}: awaiting confirmation`,
|
||||
labelDone: `Published secret key for group ${groupId}: success!`,
|
||||
done: false,
|
||||
groupId,
|
||||
},
|
||||
...prev,
|
||||
]);
|
||||
}
|
||||
setIsLoading(false);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Failed to encrypt and publish symmetric key for group chat:", error.message || "An error occurred");
|
||||
setIsLoading(false);
|
||||
});
|
||||
|
||||
}, ...prev])
|
||||
}
|
||||
setIsLoading(false)
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user