✨ (share) add error notif if the account doesn't exist
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.account-public {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user