IOS Chrome can not set a string and returns nothing #1169
Replies: 2 comments 3 replies
-
Can anyone help? |
Beta Was this translation helpful? Give feedback.
1 reply
-
2 years later, same issue |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am using zustand V3 with react V18 and typescript, the problem is on IOS platforms using chrome and google
the code that set an access token is not working
here is my code
if (typeof data === "string") { setLoading(false); setAccess(data); setIsLogIn(true); navigate("profile"); } else { alert("Wallet address and telegram Id is used before"); window.location.reload(); }
in the above code I am trying to send an request to the server to get the access token and want to save that token to the
access
state and use it everywherealso should mention that I am storing the token to the cookies as well
store.ts
`
import create from "zustand";
interface USER {
access: string;
setAccess: (access: string) => void;
setIsLogIn: (data: boolean) => void;
isLoggedIn: boolean;
onLogin: boolean;
setOnLogin: (data: boolean) => void;
ref: string | null;
setRef: (ref: string) => void;
}
export const useLogin = create((set) => ({
access: "",
isLoggedIn: false,
onLogin: true,
ref: null,
setRef: (ref) => set((state) => ({ ...state, ref })),
setAccess: (token) => set((state) => ({ ...state, access: token })),
setIsLogIn: (data) => set((state) => ({ ...state, isLoggedIn: data })),
setOnLogin: (data) => set((state) => ({ ...state, onLogin: data })),
}));
`
the code above is ok when using any other platforms such as macOS and android and even safari in IOS
but not saving the
access
on IOS search engines such as firefox chrome and googleBeta Was this translation helpful? Give feedback.
All reactions