diff --git a/src/components/layouts/Settings.vue b/src/components/layouts/Settings.vue index 67f5464fb..5d45daff9 100644 --- a/src/components/layouts/Settings.vue +++ b/src/components/layouts/Settings.vue @@ -40,6 +40,24 @@ +
+
+ +

+ {{ $t('Ask for a label when sending to an unknown address?') }} +

+
+ + +
+
diff --git a/src/components/modals/SendModal.vue b/src/components/modals/SendModal.vue index a7474b9dd..06e953430 100644 --- a/src/components/modals/SendModal.vue +++ b/src/components/modals/SendModal.vue @@ -248,6 +248,7 @@ export default defineComponent({ const { state: addresses$, activeAddressInfo, addressInfos } = useAddressStore(); const { contactsArray: contacts, setContact, getLabel } = useContactsStore(); const { state: network$ } = useNetworkStore(); + const { amountsHidden, askForRecipientLabeling } = useSettingsStore(); const recipientDetailsOpened = ref(false); const recipientWithLabel = ref<{address: string, label: string, type: RecipientType} | null>(null); @@ -295,7 +296,7 @@ export default defineComponent({ } recipientWithLabel.value = { address, label, type }; - if (!label) { + if (askForRecipientLabeling.value && !label) { recipientDetailsOpened.value = true; } else { page.value = Pages.AMOUNT_INPUT; @@ -542,8 +543,6 @@ export default defineComponent({ feeSelectionOpened.value = false; } - const { amountsHidden } = useSettingsStore(); - return { // General Pages, diff --git a/src/stores/Settings.ts b/src/stores/Settings.ts index 012224967..bd24ea33d 100644 --- a/src/stores/Settings.ts +++ b/src/stores/Settings.ts @@ -12,6 +12,7 @@ export type SettingsState = { language: string, // locale colorMode: ColorMode, amountsHidden: boolean, + askForRecipientLabeling: boolean, }; export const useSettingsStore = createStore({ @@ -21,12 +22,14 @@ export const useSettingsStore = createStore({ language: detectLanguage(), colorMode: ColorMode.AUTOMATIC, amountsHidden: false, + askForRecipientLabeling: true, }), getters: { decimals: (state): Readonly => state.decimals, language: (state): Readonly => state.language, colorMode: (state): Readonly => state.colorMode, amountsHidden: (state): Readonly => state.amountsHidden, + askForRecipientLabeling: (state): Readonly => state.askForRecipientLabeling, }, actions: { setDecimals(num: 0 | 2 | 5 = 0) { @@ -41,6 +44,9 @@ export const useSettingsStore = createStore({ this.state.colorMode = colorMode; } }, + setAskForRecipientLabeling(ask: boolean) { + this.state.askForRecipientLabeling = ask; + }, toggleAmountsHidden() { this.state.amountsHidden = !this.state.amountsHidden; },