From 5e687e871f08b409baefc6297d1e23d8cc0eb886 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 20 Dec 2022 13:29:38 +0800 Subject: [PATCH] Bring back polling but bump up timeout - Polling is needed because status post requires the media to be done processing (not just uploaded) - But the default timeout set in masto.js is 3s, a bit too low if uploading a large video - Bumping up to 30s --- src/app.jsx | 2 ++ src/components/compose.jsx | 1 - src/compose.jsx | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app.jsx b/src/app.jsx index 5613c658..53e6c177 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -144,6 +144,7 @@ export function App() { url: `https://${instanceURL}`, accessToken, disableVersionCheck: true, + timeout: 30_000, }); const mastoAccount = await masto.accounts.verifyCredentials(); @@ -185,6 +186,7 @@ export function App() { url: `https://${instanceURL}`, accessToken, disableVersionCheck: true, + timeout: 30_000, }); setIsLoggedIn(true); } catch (e) { diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 9d82d6a5..cfdbc63c 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -542,7 +542,6 @@ function Compose({ const params = { file, description, - skipPolling: true, }; return masto.mediaAttachments.create(params).then((res) => { if (res.id) { diff --git a/src/compose.jsx b/src/compose.jsx index 88fa3990..a171ac73 100644 --- a/src/compose.jsx +++ b/src/compose.jsx @@ -29,6 +29,7 @@ if (window.opener) { url: `https://${instanceURL}`, accessToken, disableVersionCheck: true, + timeout: 30_000, }); console.info('Logged in successfully.'); } catch (e) {