Browse Source

Merge pull request 'refactor: modernize registration prompt notification in ContactQRScanShowView' (#197) from registration-prompt-parity into master

Reviewed-on: https://gitea.anomalistdesign.com/trent_larson/crowd-funder-for-time-pwa/pulls/197
master
Jose Olarte 3 1 week ago
parent
commit
8815f36596
  1. 32
      src/views/ContactQRScanShowView.vue

32
src/views/ContactQRScanShowView.vue

@ -748,24 +748,17 @@ export default class ContactQRScanShow extends Vue {
!contact.registered !contact.registered
) { ) {
setTimeout(() => { setTimeout(() => {
this.notify.confirm( this.$notify(
"Do you want to register them?",
{ {
group: "modal",
type: "confirm",
title: "Register",
text: "Do you want to register them?",
onCancel: async (stopAsking?: boolean) => { onCancel: async (stopAsking?: boolean) => {
if (stopAsking) { await this.handleRegistrationPromptResponse(stopAsking);
await this.$updateSettings({
hideRegisterPromptOnNewContact: stopAsking,
});
this.hideRegisterPromptOnNewContact = stopAsking;
}
}, },
onNo: async (stopAsking?: boolean) => { onNo: async (stopAsking?: boolean) => {
if (stopAsking) { await this.handleRegistrationPromptResponse(stopAsking);
await this.$updateSettings({
hideRegisterPromptOnNewContact: stopAsking,
});
this.hideRegisterPromptOnNewContact = stopAsking;
}
}, },
onYes: async () => { onYes: async () => {
await this.register(contact); await this.register(contact);
@ -895,6 +888,17 @@ export default class ContactQRScanShow extends Vue {
videoElement.style.transform = shouldMirror ? "scaleX(-1)" : "none"; videoElement.style.transform = shouldMirror ? "scaleX(-1)" : "none";
} }
} }
private async handleRegistrationPromptResponse(
stopAsking?: boolean,
): Promise<void> {
if (stopAsking) {
await this.$saveSettings({
hideRegisterPromptOnNewContact: stopAsking,
});
this.hideRegisterPromptOnNewContact = stopAsking;
}
}
} }
</script> </script>

Loading…
Cancel
Save