mirror of
https://github.com/Qortal/qortal-mobile.git
synced 2025-06-22 07:31:22 +00:00
fixes
This commit is contained in:
parent
fe63d9c0ff
commit
9113267dc2
@ -644,7 +644,17 @@ isDOMContentLoaded: false
|
|||||||
if (event?.data?.requestedHandler !== 'UI') return;
|
if (event?.data?.requestedHandler !== 'UI') return;
|
||||||
|
|
||||||
const sendMessageToRuntime = (message, eventPort) => {
|
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,
|
name: appName, service: appService, tabId,
|
||||||
}, skipAuth)
|
}, skipAuth)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
@ -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) => {
|
return new Promise((resolve, reject) => {
|
||||||
const requestId = generateRequestId(); // Unique ID for each request
|
const requestId = generateRequestId(); // Unique ID for each request
|
||||||
callbackMap.set(requestId, { resolve, reject }); // Store both resolve and reject callbacks
|
callbackMap.set(requestId, { resolve, reject }); // Store both resolve and reject callbacks
|
||||||
|
@ -407,7 +407,7 @@ export const publishData = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const chunkUrl = uploadDataUrl + `/chunk`;
|
const chunkUrl = uploadDataUrl + `/chunk`;
|
||||||
const chunkSize = 1 * 1024 * 1024; // 1MB
|
const chunkSize = 5 * 1024 * 1024; // 5MB
|
||||||
|
|
||||||
const totalChunks = Math.ceil(file.size / chunkSize);
|
const totalChunks = Math.ceil(file.size / chunkSize);
|
||||||
if (appInfo?.tabId) {
|
if (appInfo?.tabId) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user