From 8b90b8f6a86a70c59daaea5320a40e54a612f2e1 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 26 Jan 2022 14:41:41 +0100 Subject: [PATCH] fix: namespace archive success message --- src/i18n/lang/en.json | 1 + src/views/namespaces/settings/archive.vue | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 306eb3f5..c8afd39b 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -335,6 +335,7 @@ "archiveText": "You won't be able to edit this namespace or create new lists until you un-archive it. This will also archive all lists in this namespace.", "unarchiveText": "You will be able to create new lists or edit it.", "success": "The namespace was successfully archived.", + "unarchiveSuccess": "The namespace was successfully un-archived.", "description": "If a namespace is archived, you cannot create new lists or edit it." }, "delete": { diff --git a/src/views/namespaces/settings/archive.vue b/src/views/namespaces/settings/archive.vue index e08457e9..d9ecc3d7 100644 --- a/src/views/namespaces/settings/archive.vue +++ b/src/views/namespaces/settings/archive.vue @@ -37,12 +37,13 @@ export default { methods: { async archiveNamespace() { try { + const isArchived = !this.namespace.isArchived const namespace = await this.namespaceService.update({ ...this.namespace, - isArchived: !this.namespace.isArchived, + isArchived, }) this.$store.commit('namespaces/setNamespaceById', namespace) - this.$message.success({message: this.$t('namespace.archive.success')}) + this.$message.success({message: this.$t(isArchived ? 'namespace.archive.success' : 'namespace.archive.unarchiveSuccess')}) } finally { this.$router.back() }