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 { } } + +