From 45de1d2ec64d21c04b803d26fd3c525476462d01 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 23 Aug 2020 12:21:43 +0200 Subject: [PATCH] :sparkles: (share) add error notif if the account doesn't exist --- src/views/accounts/AccountPublic.vue | 32 +++++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/views/accounts/AccountPublic.vue b/src/views/accounts/AccountPublic.vue index cbf3665..21fdd6d 100644 --- a/src/views/accounts/AccountPublic.vue +++ b/src/views/accounts/AccountPublic.vue @@ -33,17 +33,25 @@ export default class AccountPublic extends Vue { } } } catch (error) { - this.account = await accountService.getRemote(this.id) + try { + this.account = await accountService.getRemote(this.id) - if (this.account && this.account.isPublic) { - this.addAccountId({ accountId: this.id }) - await couchService.initLive() - queueNotifService.success( - `Récupération du compte public ${this.account.name} en cours...` + if (this.account && this.account.isPublic) { + this.addAccountId({ accountId: this.id }) + await couchService.initLive() + queueNotifService.success( + `Récupération du compte public ${this.account.name} en cours...` + ) + } + } catch (err) { + queueNotifService.error( + `Oups, le compte n'existe pas, êtes-vous sûr d'avoir récupérer le bon lien ?` ) - return + this.$router.push({ + name: 'account', + params: { id: this.id } + }) } - return } } @@ -59,3 +67,11 @@ export default class AccountPublic extends Vue { } } + +