Skip to content

Commit

Permalink
fix(app): hide screenshot button on embed view
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenlx committed Feb 14, 2024
1 parent b60f72c commit 6d95588
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions apps/app/src/media-view/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { takeTimestamp } from "@/media-note/timestamp/timestamp";
import { openOrCreateMediaNote } from "@/media-note/timestamp/utils";
import type MediaExtended from "@/mx-main";
import type { MediaInfo } from "./media-info";
import type { MediaViewType } from "./view-type";
import { MEDIA_EMBED_VIEW_TYPE, type MediaViewType } from "./view-type";

export interface PlayerComponent extends Component {
plugin: MediaExtended;
Expand Down Expand Up @@ -49,13 +49,14 @@ export function addAction(player: PlayerComponent & ItemView) {
takeTimestamp(player, ctx),
);
});
player.addAction("camera", "Screenshot", () => {
const info = player.getMediaInfo();
if (!info) return;
openOrCreateMediaNote(info, player).then((ctx) =>
saveScreenshot(player, ctx),
);
});
if (player.getViewType() !== MEDIA_EMBED_VIEW_TYPE)
player.addAction("camera", "Screenshot", () => {
const info = player.getMediaInfo();
if (!info) return;
openOrCreateMediaNote(info, player).then((ctx) =>
saveScreenshot(player, ctx),
);
});
}

export function onPaneMenu<
Expand Down

0 comments on commit 6d95588

Please sign in to comment.