mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
converted sendmessage
This commit is contained in:
@@ -471,16 +471,17 @@ isDOMContentLoaded: false
|
||||
|
||||
}, []); // Empty dependency array to run once when the component mounts
|
||||
|
||||
chrome.runtime?.onMessage.addListener( function (message, sender, sendResponse) {
|
||||
if(message.action === "SHOW_SAVE_FILE_PICKER"){
|
||||
showSaveFilePicker(message?.data)
|
||||
}
|
||||
// TODO
|
||||
// chrome.runtime?.onMessage.addListener( function (message, sender, sendResponse) {
|
||||
// if(message.action === "SHOW_SAVE_FILE_PICKER"){
|
||||
// showSaveFilePicker(message?.data)
|
||||
// }
|
||||
|
||||
else if (message.action === "getFileFromIndexedDB") {
|
||||
handleGetFileFromIndexedDB(message.fileId, sendResponse);
|
||||
return true; // Keep the message channel open for async response
|
||||
}
|
||||
});
|
||||
// else if (message.action === "getFileFromIndexedDB") {
|
||||
// handleGetFileFromIndexedDB(message.fileId, sendResponse);
|
||||
// return true; // Keep the message channel open for async response
|
||||
// }
|
||||
// });
|
||||
|
||||
return {path, history, resetHistory, changeCurrentIndex}
|
||||
};
|
||||
|
@@ -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);
|
||||
|
@@ -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.');
|
||||
}
|
||||
|
@@ -184,7 +184,8 @@ export const MobileFooter = ({
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
onClick={() => {
|
||||
chrome.tabs.create({ url: "https://www.qort.trade"});
|
||||
// TODO
|
||||
// chrome.tabs.create({ url: "https://www.qort.trade"});
|
||||
}}
|
||||
icon={
|
||||
<IconWrapper label="Trading" color="rgba(250, 250, 250, 0.5)">
|
||||
|
Reference in New Issue
Block a user