fix usenet search for *

This commit is contained in:
zefie
2022-10-14 00:18:46 -04:00
parent 6cfb0b7b42
commit 5d0b98677d

View File

@@ -99,14 +99,14 @@ class WTVNews {
listGroups(search = null) { listGroups(search = null) {
// list of groups on the server // list of groups on the server
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log('listGroups search', search) if (search === "*") search = null;
if (!search) { if (!search) {
this.client.list().then((data) => { this.client.list().then((data) => {
console.log('listGroups data', data) console.log('listGroups data', data)
resolve(this.processGroupList(data)); resolve(this.processGroupList(data));
}).catch((e) => { }).catch((e) => {
console.error(" * WTVNews Error:", "Command: listGroups (all)", e); console.error(" * WTVNews Error:", "Command: listGroups (all)", e);
reject(`No such group <b>${group}</b>`); reject(e);
}); });
} else { } else {
this.client.listNewsgroups('*' + search + '*').then((data) => { this.client.listNewsgroups('*' + search + '*').then((data) => {
@@ -114,7 +114,7 @@ class WTVNews {
resolve(this.processGroupList(data)); resolve(this.processGroupList(data));
}).catch((e) => { }).catch((e) => {
console.error(" * WTVNews Error:", "Command: listGroups (all)", e); console.error(" * WTVNews Error:", "Command: listGroups (all)", e);
reject(`No such group <b>${group}</b>`); reject(e);
}); });
} }
}) })