diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 3d5f13235ce7..9de5ffc8aa64 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -64,7 +64,6 @@ "useCssModule": true, "useCssVars": true, "useDelegate": true, - "useEmailSubscription": true, "useEns": true, "useExtendedSpaces": true, "useFlashNotification": true, @@ -114,6 +113,8 @@ "watchSyncEffect": true, "watchTxStatus": true, "toValue": true, - "useFlaggedMessageStatus": true + "useFlaggedMessageStatus": true, + "useEmailSubscription": true, + "useEmailFetchClient": true } } diff --git a/package.json b/package.json index d98c85273afb..bbeccba31b6d 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "@snapshot-labs/lock": "^0.1.1015", "@snapshot-labs/pineapple": "^0.1.0-beta.1", "@snapshot-labs/snapshot.js": "^0.4.86", - "@snapshot-labs/tune": "^0.1.21", + "@snapshot-labs/tune": "0.1.24", "@vue/apollo-composable": "4.0.0-beta.4", "@vueuse/core": "^10.1.2", "@vueuse/head": "^1.1.26", diff --git a/src/components/MenuAccount.vue b/src/components/MenuAccount.vue index dc98fbcc17f6..309bb115d31b 100644 --- a/src/components/MenuAccount.vue +++ b/src/components/MenuAccount.vue @@ -8,8 +8,12 @@ const { t } = useI18n(); const { domain } = useApp(); const { logout } = useWeb3(); +const { isSubscribed, loadEmailSubscriptions } = useEmailSubscription(); + +onMounted(loadEmailSubscriptions); + const router = useRouter(); -const modalEmailSubscriptionOpen = ref(false); +const showModalEmail = ref(false); function handleAction(e) { if (e === 'viewProfile') @@ -26,7 +30,7 @@ function handleAction(e) { name: 'delegate' }); if (e === 'subscribeEmail') { - modalEmailSubscriptionOpen.value = true; + showModalEmail.value = true; return true; } return logout(); @@ -53,7 +57,9 @@ function handleAction(e) { extras: { icon: 'switch' } }, { - text: t('emailSubscription.subscribe'), + text: isSubscribed + ? t('emailSubscription.manage') + : t('emailSubscription.subscribe'), action: 'subscribeEmail', extras: { icon: 'mail' } }, @@ -89,11 +95,17 @@ function handleAction(e) { + + diff --git a/src/components/ModalEmailManagement.vue b/src/components/ModalEmailManagement.vue new file mode 100644 index 000000000000..e170ff2cef49 --- /dev/null +++ b/src/components/ModalEmailManagement.vue @@ -0,0 +1,84 @@ + + + diff --git a/src/components/ModalEmailSubscription.vue b/src/components/ModalEmailSubscription.vue index 84eeee22d5d2..4295f0674640 100644 --- a/src/components/ModalEmailSubscription.vue +++ b/src/components/ModalEmailSubscription.vue @@ -1,22 +1,29 @@ @@ -27,7 +34,7 @@ function submit() {

{{ $t('emailSubscription.title') }}

-
+
@@ -46,7 +53,7 @@ function submit() {
{{ $t('emailSubscription.description') }}
-
+ -