fix(rpubs): fix shadow root double-attach and PDF generate route
- Guard attachShadow with existing check to prevent crash on reconnect - Fix API path: /pubs/api/generate → /rpubs/api/generate (module ID is rpubs) - The "Unexpected non-whitespace character" error was HTML 404 parsed as JSON Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c23d7eb65b
commit
d39c24c61b
|
|
@ -98,7 +98,7 @@ export class FolkPubsEditor extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
async connectedCallback() {
|
async connectedCallback() {
|
||||||
this.attachShadow({ mode: "open" });
|
if (!this.shadowRoot) this.attachShadow({ mode: "open" });
|
||||||
this._tour = new TourEngine(
|
this._tour = new TourEngine(
|
||||||
this.shadowRoot!,
|
this.shadowRoot!,
|
||||||
FolkPubsEditor.TOUR_STEPS,
|
FolkPubsEditor.TOUR_STEPS,
|
||||||
|
|
@ -598,7 +598,7 @@ export class FolkPubsEditor extends HTMLElement {
|
||||||
this.render();
|
this.render();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`/${this._spaceSlug}/pubs/api/generate`, {
|
const res = await fetch(`/${this._spaceSlug}/rpubs/api/generate`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue