mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-09 04:16:38 +00:00
Avoid using reportResult
if installing lib/core
Closes #1529 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
parent
aa0807ca3f
commit
019b2d5588
@ -370,8 +370,8 @@ export class CoreClientProvider {
|
|||||||
);
|
);
|
||||||
progressHandler?.reportProgress(message);
|
progressHandler?.reportProgress(message);
|
||||||
},
|
},
|
||||||
reportResult: (result) => progressHandler?.reportResult(result),
|
|
||||||
},
|
},
|
||||||
|
reportResult: (result) => progressHandler?.reportResult(result),
|
||||||
progressId,
|
progressId,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -163,14 +163,17 @@ export namespace ExecuteWithProgress {
|
|||||||
* _unknown_ progress if falsy.
|
* _unknown_ progress if falsy.
|
||||||
*/
|
*/
|
||||||
readonly progressId?: string;
|
readonly progressId?: string;
|
||||||
readonly responseService: Partial<
|
readonly responseService: Partial<ResponseService>;
|
||||||
ResponseService & { reportResult: (result: DownloadResult) => void }
|
/**
|
||||||
>;
|
* It's only relevant for index updates to build a summary of possible client (4xx) and server (5xx) errors when downloading the files during the index update. It's missing for lib/platform installations.
|
||||||
|
*/
|
||||||
|
readonly reportResult?: (result: DownloadResult) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createDataCallback<R extends ProgressResponse>({
|
export function createDataCallback<R extends ProgressResponse>({
|
||||||
responseService,
|
responseService,
|
||||||
progressId,
|
progressId,
|
||||||
|
reportResult,
|
||||||
}: ExecuteWithProgress.Options): (response: R) => void {
|
}: ExecuteWithProgress.Options): (response: R) => void {
|
||||||
const uuid = v4();
|
const uuid = v4();
|
||||||
let message = '';
|
let message = '';
|
||||||
@ -252,8 +255,8 @@ export namespace ExecuteWithProgress {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (phase instanceof DownloadProgressEnd) {
|
} else if (phase instanceof DownloadProgressEnd) {
|
||||||
if (url) {
|
if (url && reportResult) {
|
||||||
responseService.reportResult?.({
|
reportResult({
|
||||||
url,
|
url,
|
||||||
message: phase.getMessage(),
|
message: phase.getMessage(),
|
||||||
success: phase.getSuccess(),
|
success: phase.getSuccess(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user