Skip to content

Commit

Permalink
Uses Container pattern to load data into RevisionsDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Dec 13, 2023
1 parent aa2825c commit b078251
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/common/dialog/RevisionsDialogContainer.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
import { viewer } from "../../viewer/viewer.js";
import RevisionsDialog from "./RevisionsDialog.svelte";
const documentId = $viewer.document?.id;
const revisions = $viewer.document?.revisions;
const enabled = $viewer.document?.revision_control;
</script>

<RevisionsDialog {documentId} {revisions} {enabled} />
4 changes: 2 additions & 2 deletions src/pages/app/MainContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import ProjectAccessDialog from "@/common/dialog/ProjectAccessDialog.svelte";
import ProjectEmbedDialog from "@/common/dialog/ProjectEmbedDialog.svelte";
import ReprocessDialog from "@/common/dialog/ReprocessDialog.svelte";
import RevisionsDialog from "../../common/dialog/RevisionsDialog.svelte";
import RevisionsDialogContainer from "../../common/dialog/RevisionsDialogContainer.svelte";
import SearchTipsDialog from "@/common/dialog/SearchTipsDialog.svelte";
import UploadEmailDialog from "@/common/dialog/UploadEmailDialog.svelte";
Expand Down Expand Up @@ -76,7 +76,7 @@
{:else if $layout.accessOpen}
<Modal component={AccessDialog} on:close={hideAccess} />
{:else if $layout.viewDocumentRevisions}
<Modal component={RevisionsDialog} on:close={hideRevisions} />
<Modal component={RevisionsDialogContainer} on:close={hideRevisions} />
{:else if $layout.ownerOpen}
<Modal component={OwnerDialog} on:close={hideOwner} />
{:else if $layout.dataOpen}
Expand Down

0 comments on commit b078251

Please sign in to comment.