mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
13 lines
296 B
TypeScript
13 lines
296 B
TypeScript
"use server";
|
|
|
|
import { draftMode } from "next/headers";
|
|
|
|
export async function disableDraftMode() {
|
|
"use server";
|
|
await Promise.allSettled([
|
|
(await draftMode()).disable(),
|
|
// Simulate a delay to show the loading state
|
|
new Promise((resolve) => setTimeout(resolve, 1000)),
|
|
]);
|
|
}
|