Log errors when listing aliases

This commit is contained in:
Tusooa Zhu 2022-03-24 16:55:39 -04:00
parent 9ffe5c2ef5
commit cd9c026042
No known key found for this signature in database
GPG Key ID: 7B467EDE43A08224
2 changed files with 17 additions and 1 deletions

View File

@ -21,6 +21,7 @@ const SecurityTab = {
movedAccount: false, movedAccount: false,
moveAccountError: false, moveAccountError: false,
aliases: [], aliases: [],
listAliasesError: false,
addAliasTarget: '', addAliasTarget: '',
addedAlias: false, addedAlias: false,
addAliasError: false addAliasError: false
@ -136,9 +137,12 @@ const SecurityTab = {
}, },
fetchAliases () { fetchAliases () {
this.$store.state.api.backendInteractor.listAliases() this.$store.state.api.backendInteractor.listAliases()
.catch(() => {})
.then((res) => { .then((res) => {
this.aliases = res.aliases this.aliases = res.aliases
this.listAliasesError = false
})
.catch((error) => {
this.listAliasesError = error.error
}) })
}, },
logout () { logout () {

View File

@ -130,6 +130,18 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div
v-if="listAliasesError"
class="alert error"
>
{{ $t('settings.list_aliases_error', { error }) }}
<FAIcon
class="fa-scale-110 fa-old-padding"
icon="times"
:title="$t('settings.hide_list_aliases_error_action')"
@click="listAliasesError = false"
/>
</div>
<div> <div>
<i18n <i18n
path="settings.new_alias_target" path="settings.new_alias_target"