impaktapps-ui-builder 1.0.181 → 1.0.182
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/package.json
CHANGED
|
@@ -46,11 +46,6 @@ export const downloadFileFromUrl = (response: any, service) => {
|
|
|
46
46
|
|
|
47
47
|
export const downloadFileStream = async (params: any) => {
|
|
48
48
|
try {
|
|
49
|
-
// const response = await params.fetchservice.postStream(
|
|
50
|
-
// params.url,
|
|
51
|
-
// params.body,
|
|
52
|
-
// params.config
|
|
53
|
-
// );
|
|
54
49
|
let response: Response;
|
|
55
50
|
|
|
56
51
|
if (params.method === "GET") {
|
|
@@ -74,6 +69,12 @@ export const downloadFileStream = async (params: any) => {
|
|
|
74
69
|
throw new Error("Download failed");
|
|
75
70
|
}
|
|
76
71
|
|
|
72
|
+
// Notify when download starts
|
|
73
|
+
params.store.setNotify({
|
|
74
|
+
SuccessMessage: "File Download Started Successfully",
|
|
75
|
+
Success: true,
|
|
76
|
+
});
|
|
77
|
+
|
|
77
78
|
const fileName =
|
|
78
79
|
response.headers.get("filename") || "downloaded_file";
|
|
79
80
|
|
|
@@ -88,13 +89,13 @@ export const downloadFileStream = async (params: any) => {
|
|
|
88
89
|
suggestedName: fileName,
|
|
89
90
|
types: extension
|
|
90
91
|
? [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
{
|
|
93
|
+
description: "File",
|
|
94
|
+
accept: {
|
|
95
|
+
"application/octet-stream": [extension],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
]
|
|
98
99
|
: undefined,
|
|
99
100
|
});
|
|
100
101
|
|
|
@@ -110,8 +111,9 @@ export const downloadFileStream = async (params: any) => {
|
|
|
110
111
|
|
|
111
112
|
await writable.close();
|
|
112
113
|
|
|
114
|
+
// Notify when download completes
|
|
113
115
|
params.store.setNotify({
|
|
114
|
-
SuccessMessage:
|
|
116
|
+
SuccessMessage: `File "${fileHandle.name}" downloaded successfully.`,
|
|
115
117
|
Success: true,
|
|
116
118
|
});
|
|
117
119
|
} catch (e) {
|