Skip to content

Commit

Permalink
Fix iOS/Android copy issue in data export
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlaw committed Oct 1, 2023
1 parent 1edd270 commit 6494a95
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/DataExport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,13 @@ const DataExport = () => {
<Button
startIcon={<ContentCopyIcon />}
onClick={() => {
navigator.clipboard?.writeText(exportUrl).then(() => {
setIsCopied(true);
});
if (navigator.share) {
navigator.share({ title: "Export hkbus.app", url: exportUrl });
} else {
navigator.clipboard?.writeText(exportUrl).then(() => {
setIsCopied(true);
});
}
}}
size="large"
sx={buttonSx}
Expand Down

0 comments on commit 6494a95

Please sign in to comment.