From 7a7eefac260c6d97d96de253e4f218f8dab22895 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Mon, 2 Sep 2024 20:36:11 +0200 Subject: [PATCH] Fix ui --- apps/ui/src/components/GitSettings.vue | 8 ++++---- apps/ui/src/components/UserSettings.vue | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/ui/src/components/GitSettings.vue b/apps/ui/src/components/GitSettings.vue index e1a62189..19434c8b 100644 --- a/apps/ui/src/components/GitSettings.vue +++ b/apps/ui/src/components/GitSettings.vue @@ -75,10 +75,10 @@ export default { }, computed: { user_config() { - return this.drive_config.config || {} + return this.drive_config?.config || {}; }, github_url() { - const remote_url = this.drive_config.remote_url || ''; + const remote_url = this.drive_config?.remote_url || ''; if (remote_url.startsWith('git@github.com:')) { return remote_url.replace('git@github.com:', 'https://github.com/') .replace(/.git$/, ''); @@ -98,10 +98,10 @@ export default { }, body: JSON.stringify({ config: this.user_config, - remote_url: this.drive_config.remote_url + remote_url: this.drive_config?.remote_url }) }); - const json = await response.json(); + await response.json(); await this.$root.changeDrive(this.driveId); await this.emit('changed'); }, diff --git a/apps/ui/src/components/UserSettings.vue b/apps/ui/src/components/UserSettings.vue index 0db44419..17880e43 100644 --- a/apps/ui/src/components/UserSettings.vue +++ b/apps/ui/src/components/UserSettings.vue @@ -111,7 +111,7 @@ export default { }, methods: { async save() { - const response = await this.authenticatedClient.fetchApi(`/api/config/${this.driveId}`, { + await this.authenticatedClient.fetchApi(`/api/config/${this.driveId}`, { method: 'put', headers: { 'Content-type': 'application/json'