Skip to content

Commit

Permalink
Merge pull request #2418 from umbraco/v15/hotfix/invariant-preview-url
Browse files Browse the repository at this point in the history
Hotfix: Invariant preview url
  • Loading branch information
nielslyngsoe authored Oct 9, 2024
2 parents eb6ea53 + c8a8023 commit 3f29b61
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,15 @@ export class UmbDocumentWorkspaceContext
// Tell the server that we're entering preview mode.
await new UmbDocumentPreviewRepository(this).enter();

const preview = window.open(`preview?id=${unique}&culture=${culture}`, 'umbpreview');
preview?.focus();
const previewUrl = new URL('preview', window.location.origin);
previewUrl.searchParams.set('id', unique);

if (culture && culture !== UMB_INVARIANT_CULTURE) {
previewUrl.searchParams.set('culture', culture);
}

const previewWindow = window.open(previewUrl.toString(), `umbpreview-${unique}`);
previewWindow?.focus();
}

async #handleSaveAndPublish() {
Expand Down

0 comments on commit 3f29b61

Please sign in to comment.