Skip to content

Commit

Permalink
feat async download
Browse files Browse the repository at this point in the history
  • Loading branch information
harshmeetTS committed Feb 4, 2025
1 parent a00a6ef commit dc58e9e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/main/custom-chart-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,16 +1038,16 @@ export class CustomChartContext {
*/
this.on(
TSToChartEvent.DownloadExcelTrigger,
(payload: DownloadExcelTriggerPayload) => {
async (payload: DownloadExcelTriggerPayload) => {
logger.log(
'DownloadExcelTrigger event triggered from TS with payload:',
payload,
);
return {
return Promise.resolve({
fileName: '',
error: '',
message: 'Download Excel not implemented.',
};
});
},
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/react/use-custom-chart-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ export const useChartContext = (
payload: DownloadExcelTriggerPayload,
) => {
setChartModel(context.getChartModel());
return {
return Promise.resolve({
fileName: '',
error: '',
message: 'Download Excel not implemented.',
};
});
};
// Register all external event listeners here
getChartContextValues(context).setOnChartModelUpdate(
Expand Down
2 changes: 1 addition & 1 deletion src/types/ts-to-chart-event.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface TSToChartEventsPayloadMap {
) => void;
[TSToChartEvent.DownloadExcelTrigger]: (
payload: DownloadExcelTriggerPayload,
) => DownloadExcelTriggerResponse;
) => Promise<DownloadExcelTriggerResponse>;
}

/**
Expand Down

0 comments on commit dc58e9e

Please sign in to comment.