| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | import { useLaunchDataStore } from '@auto-launch/state/launch-data'; |
| 2 | 2 | import { digest } from '@shared/api/digest'; |
| 3 | -import { __ } from '@wordpress/i18n'; | |
| 4 | 3 | |
| 5 | 4 | export const setStatus = (msg) => { |
| 6 | 5 | useLaunchDataStore.getState().addStatusMessage(msg); |
| 7 | 6 | }; |
| @@ -14,9 +13,9 @@ | ||
| 14 | 13 | return await fn(); |
| 15 | 14 | } catch (_) { |
| 16 | 15 | setErrorMessage( |
| 17 | 16 | // translators: This is an error message shown to the user when a network request fails and is being retried |
| 18 | - __('The network seems unstable. Retrying...', 'extendify-local'), | |
| 17 | + launchStrings().errorUnstable, | |
| 19 | 18 | ); |
| 20 | 19 | await wait(1000); |
| 21 | 20 | const res = await fn(); |
| 22 | 21 | setErrorMessage(null); |
| @@ -38,8 +37,9 @@ | ||
| 38 | 37 | }; |
| 39 | 38 | |
| 40 | 39 | export const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); |
| 41 | 40 | |
| 41 | +import { launchStrings } from '@auto-launch/strings'; | |
| 42 | 42 | import apiFetch from '@wordpress/api-fetch'; |
| 43 | 43 | |
| 44 | 44 | export async function apiFetchWithTimeout(options = {}, timeoutMs = 30000) { |
| 45 | 45 | const controller = new AbortController(); |