Skip to content
Snippets Groups Projects
Verified Commit 8eb4982d authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix(filter): check against null

parent a92bf1f8
No related branches found
No related tags found
No related merge requests found
...@@ -343,7 +343,7 @@ class Rest extends Datasource { ...@@ -343,7 +343,7 @@ class Rest extends Datasource {
} }
/** /**
* Fetches the data from the rest api. * Writes the data to the rest api.
* @return {Promise} * @return {Promise}
*/ */
write() { write() {
...@@ -426,12 +426,12 @@ function initFilter() { ...@@ -426,12 +426,12 @@ function initFilter() {
this[filterObserverSymbol] = new Observer(() => { this[filterObserverSymbol] = new Observer(() => {
const query = filterControl.getOption("query"); const query = filterControl.getOption("query");
if (query === undefined) { if (query === undefined || query === null) {
return; return;
} }
this.setParameters({ query: query }); this.setParameters({ query: query });
this.fetch() this.read()
.then((response) => { .then((response) => {
if (!(response instanceof Response)) { if (!(response instanceof Response)) {
return Promise.reject(new Error("response is not a Response object")); return Promise.reject(new Error("response is not a Response object"));
...@@ -536,7 +536,7 @@ function initAutoInit() { ...@@ -536,7 +536,7 @@ function initAutoInit() {
} }
queueMicrotask(() => { queueMicrotask(() => {
this.fetch().catch(() => {}); this.read().catch(() => {});
}); });
} }
...@@ -548,7 +548,7 @@ function initEventHandler() { ...@@ -548,7 +548,7 @@ function initEventHandler() {
entries.forEach((entry) => { entries.forEach((entry) => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
if (entry.intersectionRatio > 0) { if (entry.intersectionRatio > 0) {
this.fetch(); this.read();
} }
// only load once // only load once
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment