Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: onboarding new users #116

Merged
merged 22 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: rename
Signed-off-by: Iuri Pereira <[email protected]>
  • Loading branch information
iuricmp committed Jul 17, 2024
commit 2f19ce990bd56fb3777a44f42cc241a4b9e9ee34
4 changes: 2 additions & 2 deletions mobile/app/sign-up.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Alert from "@gno/components/alert";
import useOnboarding from "@gno/hooks/use-onboarding";
import Layout from "@gno/components/layout";
import { useGnoNativeContext } from "@gnolang/gnonative";
import { SignUpState, selectProgress, signUpCheck, signUpStateSelector } from "redux/features/signupSlice";
import { SignUpState, signUp, signUpStateSelector } from "redux/features/signupSlice";
import ProgressView from "@gno/components/view/progress";

export default function Page() {
Expand Down Expand Up @@ -80,7 +80,7 @@ export default function Page() {

try {
setLoading(true);
await dispatch(signUpCheck({ name, password, phrase }));
await dispatch(signUp({ name, password, phrase }));
} catch (error) {
RNAlert.alert("Error", "" + error);
setError("" + error);
Expand Down
8 changes: 4 additions & 4 deletions mobile/redux/features/signupSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface SignUpParam {
*
* ref: https://github.com/gnolang/dsocial/issues/72
*/
export const signUpCheck = createAsyncThunk<void, SignUpParam, ThunkExtra>("user/signUp", async (param, config) => {
export const signUp = createAsyncThunk<void, SignUpParam, ThunkExtra>("user/signUp", async (param, config) => {

const { name, password, phrase } = param;
const gnonative = config.extra.gnonative as GnoNativeApi;
Expand Down Expand Up @@ -144,12 +144,12 @@ export const signUpSlice = createSlice({
clearProgress: (state) => { state.progress = []; }
},
extraReducers(builder) {
builder.addCase(signUpCheck.fulfilled, (state, action) => {
builder.addCase(signUp.fulfilled, (state, action) => {
// state.account = action.payload;
});
builder.addCase(signUpCheck.rejected, (state, action) => {
builder.addCase(signUp.rejected, (state, action) => {
action.error.message ? state.progress = [...state.progress, action.error.message] : null;
console.error("signUpCheck.rejected", action);
console.error("signUp.rejected", action);
});
},

Expand Down