Skip to content

Commit 42b2085

Browse files
committed
Convert the Publish button to gracefully mock success for guests to prevent hard lockouts in the sandbox experience
1 parent bf7b018 commit 42b2085

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

app/builder/[appId]/page.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,24 @@ export default function BuilderPage() {
191191
const [isPublishing, setIsPublishing] = useState(false);
192192

193193
const handlePublish = async () => {
194+
if (!checkGuestUsageLimit()) return;
195+
196+
setIsPublishing(true);
197+
198+
// If not signed in, mock the publish cleanly so guests can exhaust their quota without hitting the authentication wall instantly
194199
if (!isSignedIn) {
195-
setAuthRequireMessage(
196-
"You must be signed in to publish your application.",
197-
);
200+
setTimeout(() => {
201+
setNotificationModal({
202+
type: "success",
203+
title: "Mock Publish Successful",
204+
message:
205+
"Guest applications cannot be hosted live. However, here's a simulated success! Sign in to claim a permanent URL.",
206+
});
207+
setIsPublishing(false);
208+
}, 800);
198209
return;
199210
}
200-
setIsPublishing(true);
211+
201212
try {
202213
const res = await publishAppConfig(appId, configStr);
203214
if (res && res.success === false) throw new Error(res.error);

0 commit comments

Comments
 (0)