stupid hacky bullshit for my web interface
ci/woodpecker/push/woodpecker Pipeline failed Details

master
Drake 1 year ago
parent bff0834722
commit 432e96ee2e

@ -15,6 +15,7 @@ export default class Chapter {
#summary!: string;
#startNote!: string;
#endNote!: string;
earlyName?: string;
id!: Promise<ID>;
workID!: Promise<ID>;
name!: Promise<string>;
@ -24,16 +25,26 @@ export default class Chapter {
startNote!: Promise<string>;
endNote!: Promise<string>;
constructor(workId: ID, id: ID, session: {
get: (path: string) => Promise<Response>;
}, DOMParser: DOMParser) {
constructor(
workId: ID,
id: ID,
session: {
get: (path: string) => Promise<Response>;
},
DOMParser: DOMParser,
extraInfo: Record<string, any>,
) {
this.#session = session;
this.#workID = workId;
this.#id = id;
this.#DOMParser = DOMParser;
this.earlyName = extraInfo.name;
return new Proxy(this, {
get: async (target, prop) => {
if (prop === "earlyName") {
return this.earlyName;
}
if (!this.isInited) {
await target.init();
target.isInited = true;

@ -124,6 +124,7 @@ export default class Work {
this.id,
this.#session,
this.#DOMParser,
{},
);
this.chapters.push(
newChapter,
@ -148,6 +149,7 @@ export default class Work {
c.getAttribute("value") as string,
this.#session,
this.#DOMParser,
{ name: c.innerText },
);
this.chapters.push(
newChapter,

Loading…
Cancel
Save