diff --git a/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.ts b/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.ts index 7fa95142..8dabd865 100644 --- a/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.ts +++ b/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.ts @@ -45,6 +45,14 @@ export default class LegalDisclaimer extends MetaView { */ legalAccepted = false; + /** + * This computed returns + * current configuration of the legal page + * configuration is getting according to route name + * + * @access public + * @returns {any} + */ get legalData() { const currentKey = this.$route.name?.split(".")[1]; const currentLegalItem = this.$t(`legal.${currentKey}`); @@ -54,4 +62,23 @@ export default class LegalDisclaimer extends MetaView { return this.$t("legal.terms-and-conditions"); } + + /** + * This method handles submitting + * of accepted documents. + * + * @access public + * @returns {void} + */ + public handleAccept() { + // temporary storing of accepted Terms and Conditions in localStorage + // @todo discuss the way of storing accepted Terms and Conditions + const currentKey = this.$route.name?.split(".")[1]; + localStorage.setItem( + `${currentKey}_accepted`, + JSON.stringify(this.legalAccepted) + ); + + this.$router.push({ name: "app.login" }); + } } diff --git a/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.vue b/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.vue index 89b06feb..c2abb5e8 100644 --- a/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.vue +++ b/runtime/dapp-frontend-vue/src/views/LegalDisclaimer/LegalDisclaimer.vue @@ -55,7 +55,7 @@ - {{ + {{ legalData.button }} diff --git a/runtime/dapp-frontend-vue/src/views/OnboardingScreen/OnboardingScreen.ts b/runtime/dapp-frontend-vue/src/views/OnboardingScreen/OnboardingScreen.ts index d9d606c9..4ed07262 100644 --- a/runtime/dapp-frontend-vue/src/views/OnboardingScreen/OnboardingScreen.ts +++ b/runtime/dapp-frontend-vue/src/views/OnboardingScreen/OnboardingScreen.ts @@ -115,7 +115,13 @@ export default class OnboardingScreen extends MetaView { route: this.$route.name, refCode: this.refCode, }); - this.$router.push({ name: "legal.terms-and-conditions" }); + const termsAccepted = !!JSON.parse( + localStorage.getItem("terms-and-conditions_accepted") as string + ); + + termsAccepted + ? this.$router.push({ name: "app.login" }) + : this.$router.push({ name: "legal.terms-and-conditions" }); } /**