Skip to content

Commit 3b1e84e

Browse files
committed
fix: use loadingPlaceholder for local files, remove EDITOR_READY wait
1 parent c0d66b3 commit 3b1e84e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

examples/with-playwright-automation/src/automation.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,15 @@ const runAutomation = async ({ document, baseUrl }: { document: string; baseUrl:
183183

184184
const editorUrl = isUrl(document)
185185
? `${baseUrl}/editor?open=${encodeURIComponent(document)}`
186-
: `${baseUrl}/editor`;
186+
: `${baseUrl}/editor?loadingPlaceholder=true`;
187187

188188
const { sendEvent, waitForEvent, waitForDocumentLoaded } = await setupIframePage({
189189
page,
190190
editorUrl,
191191
});
192192

193193
if (!isUrl(document)) {
194-
console.log('Waiting for editor to be ready...');
195-
await waitForEvent('EDITOR_READY');
196-
console.log('Editor ready, loading local file...');
197-
194+
console.log('Loading local file...');
198195
const dataUrl = readFileAsDataUrl({ filePath: document });
199196
const fileName = path.basename(document);
200197
await sendEvent({ type: 'LOAD_DOCUMENT', data: { data_url: dataUrl, name: fileName } });

0 commit comments

Comments
 (0)