@lvce-editor/main-process 6.32.0 → 6.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mainProcessMain.js +5 -18
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -5793,24 +5793,11 @@ const showMessageBox = async ({
|
|
|
5793
5793
|
|
|
5794
5794
|
const getJson = async url => {
|
|
5795
5795
|
string(url);
|
|
5796
|
-
const
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
await new Promise(resolve => {
|
|
5802
|
-
request.on('response', response => {
|
|
5803
|
-
response.on('data', chunk => {
|
|
5804
|
-
body += chunk.toString();
|
|
5805
|
-
});
|
|
5806
|
-
response.on('end', () => {
|
|
5807
|
-
resolve(undefined);
|
|
5808
|
-
});
|
|
5809
|
-
});
|
|
5810
|
-
request.end();
|
|
5811
|
-
});
|
|
5812
|
-
const json = JSON.parse(body);
|
|
5813
|
-
return json;
|
|
5796
|
+
const response = await net.fetch(url);
|
|
5797
|
+
if (!response.ok) {
|
|
5798
|
+
throw new Error(`Failed to fetch JSON: ${response.status} ${response.statusText}`);
|
|
5799
|
+
}
|
|
5800
|
+
return response.json();
|
|
5814
5801
|
};
|
|
5815
5802
|
|
|
5816
5803
|
const startLogging = async path => {
|