This commit is contained in:
PhilReact 2025-06-21 15:20:50 +03:00
parent fe63d9c0ff
commit 9113267dc2
3 changed files with 13 additions and 3 deletions

View File

@ -644,7 +644,17 @@ isDOMContentLoaded: false
if (event?.data?.requestedHandler !== 'UI') return;
const sendMessageToRuntime = (message, eventPort) => {
window.sendMessage(message.action, message.payload, 300000, message.isExtension, {
let timeout: number = 300000;
if (
message?.action === 'PUBLISH_MULTIPLE_QDN_RESOURCES' &&
message?.payload?.resources?.length > 0
) {
timeout = message?.payload?.resources?.length * 1200000;
} else if (message?.action === 'PUBLISH_QDN_RESOURCE') {
timeout = 1200000;
}
window.sendMessage(message.action, message.payload, timeout, message.isExtension, {
name: appName, service: appService, tabId,
}, skipAuth)
.then((response) => {

View File

@ -24,7 +24,7 @@ window.addEventListener("message", (event) => {
}
});
export const sendMessageBackground = (action, data = {}, timeout = 240000, isExtension, appInfo, skipAuth) => {
export const sendMessageBackground = (action, data = {}, timeout = 600000, isExtension, appInfo, skipAuth) => {
return new Promise((resolve, reject) => {
const requestId = generateRequestId(); // Unique ID for each request
callbackMap.set(requestId, { resolve, reject }); // Store both resolve and reject callbacks

View File

@ -407,7 +407,7 @@ export const publishData = async ({
}
const chunkUrl = uploadDataUrl + `/chunk`;
const chunkSize = 1 * 1024 * 1024; // 1MB
const chunkSize = 5 * 1024 * 1024; // 5MB
const totalChunks = Math.ceil(file.size / chunkSize);
if (appInfo?.tabId) {