Miising initialization, fix undefined category

pull/73/head
MillenniumEarl 2021-03-03 20:27:13 +01:00
parent 5958c80ab7
commit 18c901288e
1 changed files with 6 additions and 4 deletions

View File

@ -43,8 +43,8 @@ export default class ThreadSearchQuery implements IQuery {
* Minimum number of answers that the thread must possess. * Minimum number of answers that the thread must possess.
*/ */
public minimumReplies: number = 0; public minimumReplies: number = 0;
public includedPrefixes: string[]; public includedPrefixes: string[] = [];
public category: TCategory; public category: TCategory = null;
/** /**
* Results presentation order. * Results presentation order.
*/ */
@ -114,9 +114,11 @@ export default class ThreadSearchQuery implements IQuery {
} }
// Set the category // Set the category
const catID = this.categoryToID(this.category).toString();
url.searchParams.set("c[child_nodes]", "1"); // Always set url.searchParams.set("c[child_nodes]", "1"); // Always set
if (this.category) {
const catID = this.categoryToID(this.category).toString();
url.searchParams.set("c[nodes][0]", catID); url.searchParams.set("c[nodes][0]", catID);
}
// Set the other values // Set the other values
url.searchParams.set("o", this.order.toString()); url.searchParams.set("o", this.order.toString());