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

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

Loading…
Cancel
Save