katja's git: oeffisearch

fast and simple tripplanner

commit 6286b8ff6d1adc58eed5497e935e7aeaa0755f30
parent 18be57cd691dda9574f5a4b6997c69d991470587
Author: Katja (ctucx) <git@ctu.cx>
Date: Thu, 17 Apr 2025 14:12:12 +0200

searchView: better offline support
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/searchView.js b/src/searchView.js
@@ -309,6 +309,11 @@ class SearchView extends BaseView {
 	submitHandler = async event => {
 		event.preventDefault();
 
+		if (this.isOffline !== false) {
+			this.showAlertOverlay(t('offline'));
+			return;
+		}
+
 		const params = {
 			from: null,
 			to: null,

@@ -481,6 +486,7 @@ class SearchView extends BaseView {
 		const value = event.target.value.trim();
 
 		if (['from', 'via', 'to'].includes(name)) { 
+			if (this.isOffline !== false) return;
 			if (value === '') return;
 
 			this.location[name].value = value;