feat: consolidate local-first mnote web runtime
This commit is contained in:
@@ -59,6 +59,7 @@ async function uploadLocalAsset(page, root, documentId, fileName, mimeType, byte
|
||||
const form = new FormData();
|
||||
form.append("rootUri", rootUri);
|
||||
form.append("documentId", documentId);
|
||||
form.append("uploadIntent", "editor.markdown.attach");
|
||||
form.append("kind", kind);
|
||||
form.append("file", new File([new Uint8Array(bytes)], fileName, { type: mimeType }));
|
||||
const response = await fetch("/api/local-folder/assets/upload", { method: "POST", body: form });
|
||||
@@ -173,7 +174,7 @@ async function main() {
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// 尝试关闭 dirty 的 resource tab — 应被阻止
|
||||
const closeBtn = page.locator('.mnote-main-tab.is-active .mnote-main-tab-close');
|
||||
const closeBtn = page.locator('.mnote-main-tab.is-active[data-pane-role="primary"] .mnote-main-tab-close:not([data-mnote-pane-close])');
|
||||
await closeBtn.click({ timeout: UI_TIMEOUT_MS });
|
||||
await page.waitForTimeout(300);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user