Skip to content

Commit

Permalink
fix: streamline usage of custom download and share functions
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed May 17, 2023
1 parent 19594e0 commit 2944efb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/download/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function DownloadButton() {
undefined;

// slides must be explicitly marked as downloadable when custom download function is provided
const canDownload = customDownload ? Boolean(currentSlide?.download) : Boolean(downloadUrl);
const canDownload = customDownload ? currentSlide?.download !== false : Boolean(downloadUrl);

const defaultDownload = () => {
if (currentSlide && downloadUrl) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/share/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function ShareButton() {
undefined;

// slides must be explicitly marked as shareable when custom share function is provided
const canShare = customShare ? Boolean(currentSlide?.share) : share && navigator.canShare(share);
const canShare = customShare ? currentSlide?.share !== false : share && navigator.canShare(share);

const defaultShare = () => {
if (share) {
Expand Down

0 comments on commit 2944efb

Please sign in to comment.