We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f151d5 commit a06f092Copy full SHA for a06f092
src/lib/boosthub.tsx
@@ -56,9 +56,15 @@ function useBoostHubStore() {
56
method: 'get',
57
...options,
58
}
59
- return webviewRef.current!.executeJavaScript(
60
- `fetch("${url}", {method: "${method}"}).then(response => response.json())`
+ const rawText = await webviewRef.current!.executeJavaScript(
+ `fetch("${url}", {method: "${method}"}).then(response => response.text())`
61
)
62
+ try {
63
+ return JSON.parse(rawText)
64
+ } catch (error) {
65
+ console.warn('Invalid json body', error)
66
+ throw new Error(rawText)
67
+ }
68
},
69
[]
70
0 commit comments