Fixed getLogs filter deserialization (#805).

This commit is contained in:
Richard Moore 2020-04-28 04:52:29 -04:00
parent 000aaaf4e8
commit 393c0c74a9
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

View File

@ -50,6 +50,7 @@ function serializeTopics(topics: Array<string | Array<string>>): string {
sorted.sort();
return sorted.join("|");
} else {
return checkTopic(topic);
}
@ -58,10 +59,15 @@ function serializeTopics(topics: Array<string | Array<string>>): string {
function deserializeTopics(data: string): Array<string | Array<string>> {
if (data === "") { return [ ]; }
return data.split(/&/g).map((topic) => {
return topic.split("|").map((topic) => {
if (topic === "") { return [ ]; }
const comps = topic.split("|").map((topic) => {
return ((topic === "null") ? null: topic);
});
return ((comps.length === 1) ? comps[0]: comps);
});
}