Fixed race condition where the chat update function could not be used
This commit is contained in:
parent
7649f30323
commit
58c4049d09
|
@ -50,8 +50,15 @@ async function updateStatusAndThread (instanceName, accessToken, timelineName, s
|
|||
addStatusesOrNotifications(instanceName, timelineName, concat(context.ancestors, context.descendants))
|
||||
}
|
||||
|
||||
if (window.fediloveFunctions !== undefined)
|
||||
window.fediloveFunctions.updateStatusAndThread = updateStatusAndThread;
|
||||
if (typeof window !== "undefined") {
|
||||
const _this = setInterval(function() {
|
||||
if (window.fediloveFunctions != undefined) {
|
||||
window.fediloveFunctions.updateStatusAndThread = updateStatusAndThread;
|
||||
clearInterval(_this);
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
|
||||
|
||||
async function fetchFreshThreadFromNetwork (instanceName, accessToken, statusId) {
|
||||
const [status, context] = await Promise.all([
|
||||
|
|
Loading…
Reference in New Issue