Small fixes

This commit is contained in:
Natsumi
2023-06-07 18:21:41 +12:00
parent 09c4087ed4
commit 3780d61054
2 changed files with 16 additions and 13 deletions

View File

@@ -380,7 +380,11 @@ speechSynthesis.getVoices();
// merge requests
var req = this.pendingGetRequests.get(init.url);
if (typeof req !== 'undefined') {
return req;
if (req.time >= Date.now() - 10000) {
// 10s
return req.req;
}
this.pendingGetRequests.delete(init.url);
}
} else if (init.uploadImage || init.uploadFilePUT) {
// nothing
@@ -513,7 +517,7 @@ speechSynthesis.getVoices();
req.finally(() => {
this.pendingGetRequests.delete(init.url);
});
this.pendingGetRequests.set(init.url, req);
this.pendingGetRequests.set(init.url, { req, time: Date.now() });
}
return req;
};
@@ -24872,7 +24876,7 @@ speechSynthesis.getVoices();
this.updateSharedFeed(true);
};
$app.methods.instanceQueueUpdate = function (
$app.methods.instanceQueueUpdate = async function (
instanceId,
position,
queueSize
@@ -24900,18 +24904,17 @@ speechSynthesis.getVoices();
});
}
if (!ref.$groupName) {
this.getGroupName(instanceId).then((name) => {
ref.$groupName = name;
ref.$msgBox.message = `You are in position ${ref.position} of ${ref.queueSize} in the queue for ${name} `;
});
ref.$groupName = await this.getGroupName(instanceId);
}
if (!ref.$worldName) {
this.getWorldName(instanceId).then((name) => {
ref.$worldName = name;
});
ref.$worldName = await this.getWorldName(instanceId);
}
ref.$msgBox.message = `You are in position ${ref.position} of ${ref.queueSize} in the queue for ${ref.$groupName} `;
var displayLocation = this.displayLocation(
instanceId,
ref.$worldName,
ref.$groupName
);
ref.$msgBox.message = `You are in position ${ref.position} of ${ref.queueSize} in the queue for ${displayLocation} `;
API.queuedInstances.set(instanceId, ref);
};