Skip to content

Commit cea1362

Browse files
committed
Don't refresh sandbox when preview_secret = undefined
1 parent 457fc92 commit cea1362

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/app/src/sandbox/utils/preview-secret.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export const setPreviewSecret = (secret: string | null) => {
2121
) {
2222
if (secret) {
2323
document.cookie = `${PREVIEW_SECRET_COOKIE_NAME}=${secret}`;
24+
location.reload();
2425
} else {
2526
document.cookie = `${PREVIEW_SECRET_COOKIE_NAME}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
2627
}
27-
location.reload();
2828
}
2929
};

packages/sandbox-hooks/preview-secret.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export const setPreviewSecret = secret => {
2323
) {
2424
if (secret) {
2525
document.cookie = `${PREVIEW_SECRET_COOKIE_NAME}=${secret}`;
26+
location.reload();
2627
} else {
2728
document.cookie = `${PREVIEW_SECRET_COOKIE_NAME}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
2829
}
29-
location.reload();
3030
}
3131
};
3232

0 commit comments

Comments
 (0)