converted sendmessage

This commit is contained in:
2024-10-29 18:50:03 +02:00
parent c9306493f0
commit 4f91924947
35 changed files with 163 additions and 225 deletions

View File

@@ -130,6 +130,7 @@ export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey,
secretKeyObject: secretKey,
})
.then((response) => {
console.log('decryptSingle', response)
if (!response?.error) {
const filterUIMessages = encryptedMessages.filter((item) => !isExtMsg(item.data));
const decodedUIMessages = decodeBase64ForUIChatMessages(filterUIMessages);

View File

@@ -35,18 +35,18 @@ export const MessageDisplay = ({ htmlContent , isReply}) => {
const target = e.target.closest('a');
if (target) {
const href = target.getAttribute('href');
if (chrome && chrome.tabs) {
chrome.tabs.create({ url: href }, (tab) => {
if (chrome.runtime.lastError) {
console.error('Error opening tab:', chrome.runtime.lastError);
} else {
console.log('Tab opened successfully:', tab);
}
});
} else {
console.error('chrome.tabs API is not available.');
}
// TODO
// if (chrome && chrome.tabs) {
// chrome.tabs.create({ url: href }, (tab) => {
// if (chrome.runtime.lastError) {
// console.error('Error opening tab:', chrome.runtime.lastError);
// } else {
// console.log('Tab opened successfully:', tab);
// }
// });
// } else {
// console.error('chrome.tabs API is not available.');
// }
} else {
console.error('No <a> tag found or href is null.');
}