diff --git a/shell/src/dapps/o-onboarding/processes/loginWithTorus.ts b/shell/src/dapps/o-onboarding/processes/loginWithTorus.ts index 3c0b0c5bf..a9d8cdbd6 100644 --- a/shell/src/dapps/o-onboarding/processes/loginWithTorus.ts +++ b/shell/src/dapps/o-onboarding/processes/loginWithTorus.ts @@ -13,12 +13,11 @@ import HtmlViewer from "../../../../../packages/o-editors/src/HtmlViewer.svelte" import { PlatformEvent } from "@o-platform/o-events/dist/platformEvent"; import { show } from "@o-platform/o-process/dist/actions/show"; import ErrorView from "../../../shared/atoms/Error.svelte"; -import { Web3Auth, GetWeb3AuthResult } from "../../../shared/web3AuthNoModal"; +import { Web3Auth } from "../../../shared/web3AuthNoModal"; import { FindInvitationCreatorDocument, Profile, QueryFindInvitationCreatorArgs } from "../../../shared/api/data/types"; import { ApiClient } from "../../../shared/apiConnection"; import { AvataarGenerator } from "../../../shared/avataarGenerator"; import { setWindowLastError } from "../../../shared/processes/actions/setWindowLastError"; -import { OpenloginUserInfo } from "@web3auth/openlogin-adapter"; import { Environment } from "../../../shared/environment"; @@ -133,11 +132,11 @@ const processDefinition = (processId: string) => onDone: [ { cond: (context) => Environment.useMockLogin === true, - target: "#useMockProfile", + target: "useMockProfile", }, { cond: (context) => context.data.accountAddress === undefined, - target: "#chooseFlow", + target: "chooseFlow", }, { cond: (context) => context.data.accountAddress !== undefined, @@ -198,30 +197,9 @@ const processDefinition = (processId: string) => src: async (context) => { const webauth = new Web3Auth(); await webauth.init(); - let privateKey: { privKey: any } = undefined; - let userInfo: OpenloginUserInfo; - - const mockProfile = Environment.getTestProfile(context.data.useMockProfileIndex); - - if (mockProfile) { - privateKey = { - privKey: mockProfile.privateKey, - }; - - const openLogin = { - async getUserInfo(): Promise> { - delete mockProfile.privateKey; - return mockProfile; - }, - }; - - userInfo = await openLogin.getUserInfo(); - } else { - await webauth.login("mock", context.data.useMockProfileIndex); - privateKey = await webauth.getPrivateKey(); - userInfo = await webauth.getUserInfo(context.data.useMockProfileIndex); - } - + await webauth.login("mock", context.data.useMockProfileIndex); + const privateKey = await webauth.getPrivateKey(); + const userInfo = await webauth.getUserInfo(context.data.useMockProfileIndex); return { privateKey: privateKey.privKey, userInfo: userInfo, diff --git a/shell/src/dapps/o-survey/components/UserDataCollectionSurvey.svelte b/shell/src/dapps/o-survey/components/UserDataCollectionSurvey.svelte index 38d6e8e16..fd9c044b3 100644 --- a/shell/src/dapps/o-survey/components/UserDataCollectionSurvey.svelte +++ b/shell/src/dapps/o-survey/components/UserDataCollectionSurvey.svelte @@ -156,8 +156,6 @@ const options = { enableTime: false, weekNumbers: true, altInput: true, - minDate: "1900-01-01", - maxDate: "today", altFormat: "F j, Y", time_24hr: true, onChange(selectedDates, dateStr) { @@ -263,7 +261,7 @@ const options = { {#if $inviteUrl} {$_("dapps.o-homepage.components.survey.userDataCollection.inviteValid")} {:else} - {/if} @@ -289,13 +287,13 @@ const options = { {/if}
-
{#if $myForm.dirty} diff --git a/shell/src/shared/web3AuthNoModal.ts b/shell/src/shared/web3AuthNoModal.ts index 4c48b2106..ccfbd8db0 100644 --- a/shell/src/shared/web3AuthNoModal.ts +++ b/shell/src/shared/web3AuthNoModal.ts @@ -116,23 +116,10 @@ export class Web3Auth { console.log("idToken: ", idToken); }; - getUserInfo = async (mockprofileIndex: number = undefined) => { + getUserInfo = async (mockprofileIndex: number = 0) => { console.log("Mockindes:", mockprofileIndex); if (Environment.useMockLogin) { - let user: Partial; - if (mockprofileIndex) { - user = Environment.getTestProfile(mockprofileIndex); - } else { - user = { - email: "email@some.hostname.of.some.mailserver.somewhere", - name: "Oauth profile name", - typeOfLogin: "google", - profileImage: "https://some.url.to.somewhere", - aggregateVerifier: "not-verified", - verifier: "not-verified", - verifierId: "not-verified", - }; - } + const user: Partial = Environment.getTestProfile(mockprofileIndex); return user as OpenloginUserInfo; } else { if (!this.web3auth) {