From 29403013f5c3abe4bfa318558cbddeab87e7a73b Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Wed, 24 Apr 2024 22:28:59 +0200 Subject: [PATCH] Fix: Device Manager shows 404 if no pin_mapping.json was available --- webapp/src/utils/authentication.ts | 6 ++++-- webapp/src/views/DeviceAdminView.vue | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/webapp/src/utils/authentication.ts b/webapp/src/utils/authentication.ts index e0e96b705..0f1debd03 100644 --- a/webapp/src/utils/authentication.ts +++ b/webapp/src/utils/authentication.ts @@ -65,7 +65,7 @@ export function login(username: string, password: string) { }); } -export function handleResponse(response: Response, emitter: Emitter>, router: Router) { +export function handleResponse(response: Response, emitter: Emitter>, router: Router, ignore_error: boolean = false) { return response.text().then(text => { const data = text && JSON.parse(text); if (!response.ok) { @@ -78,7 +78,9 @@ export function handleResponse(response: Response, emitter: Emitter handleResponse(response, this.$emitter, this.$router)) + .then((response) => handleResponse(response, this.$emitter, this.$router, true)) .then( (data) => { this.pinMappingList = data; @@ -246,6 +246,9 @@ export default defineComponent({ .then( (data) => { this.deviceConfigList = data; + if (this.deviceConfigList.curPin.name === "") { + this.deviceConfigList.curPin.name = "Default"; + } this.dataLoading = false; } )