Skip to content

Commit

Permalink
Merge pull request #951 from MuckRock/allanlasser/issue950
Browse files Browse the repository at this point in the history
When sharing, default page to the viewer's current page
  • Loading branch information
allanlasser authored Dec 5, 2024
2 parents d871c60 + 020c48b commit 977b8bb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/components/sidebar/ViewerActions.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- Assumes its a child of ViewerContext -->

<script lang="ts">
import type { Document, Org, User } from "$lib/api/types";
Expand Down Expand Up @@ -28,11 +30,14 @@
import { getUpgradeUrl } from "$lib/api/accounts";
import { pdfUrl, canonicalUrl } from "$lib/api/documents";
import { getCurrentPage } from "../viewer/ViewerContext.svelte";
export let document: Document;
export let user: User;
export let action: string = "";
const page = getCurrentPage();
$: shareOpen = action === "share";
$: editOpen = action === "edit";
$: revisionsOpen = action === "revisions";
Expand Down Expand Up @@ -141,7 +146,7 @@
<Portal>
<Modal on:close={() => (shareOpen = false)}>
<h1 slot="title">{$_("sidebar.shareEmbed")}</h1>
<Share {document} />
<Share {document} page={$page} />
</Modal>
</Portal>
{/if}
Expand Down

0 comments on commit 977b8bb

Please sign in to comment.