Skip to content

Commit

Permalink
Merge pull request #103 from thoughtspot/add/download-async
Browse files Browse the repository at this point in the history
feat async download
  • Loading branch information
harshmeetTS authored Feb 4, 2025
2 parents a00a6ef + c01fcc8 commit 88536aa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thoughtspot/ts-chart-sdk",
"private": false,
"version": "1.2.2",
"version": "1.2.3",
"module": "lib/index",
"main": "lib/index",
"types": "lib/index",
Expand Down
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 88536aa

Please sign in to comment.