Skip to content

Commit

Permalink
Swap to using saveOnDisk for msteams app.zip download
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardDowling committed Oct 30, 2024
1 parent 1ca12a9 commit aa46746
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions web/packages/teleport/src/Integrations/IntegrationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ToolTipInfo } from 'shared/components/ToolTip';
import { ResourceIcon } from 'design/ResourceIcon';
import useStickyClusterId from 'teleport/useStickyClusterId';
import api from 'teleport/services/api';
import { saveOnDisk } from 'shared/utils/saveOnDisk';

import {
getStatusCodeDescription,
Expand Down Expand Up @@ -115,20 +116,13 @@ export function IntegrationList(props: Props<IntegrationLike>) {
</MenuItem>
)}
{item.kind === 'msteams' && (
<MenuItem onClick={() => function () {
<MenuItem onClick={() => {
api.fetch(cfg.getMsTeamsAppZipRoute(clusterId, item.name))
.then(response => response.blob())
.then(blob => {
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "app.zip";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
saveOnDisk(blob, "app.zip", "application/zip")
});
}()}>
}}>
Download app.zip
</MenuItem>
)}
Expand Down

0 comments on commit aa46746

Please sign in to comment.