Skip to content

Commit

Permalink
optimise codes
Browse files Browse the repository at this point in the history
  • Loading branch information
LastStranger committed Feb 22, 2024
1 parent 5b9353f commit ee5b02e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
"expo-system-ui": "~2.4.0",
"immer": "^10.0.3",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-native": "0.72.6",
Expand Down
2 changes: 1 addition & 1 deletion src/navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function AppNavigation() {
const userInfo = useUserStore(state => state.userInfo);
const getUserInfo = useUserStore(state => state.getUserInfo);

console.warn("AppNavigation renderings");
// console.warn("AppNavigation renderings");

useEffect(() => {
getUserInfo();
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ const Index = () => {
// return;
const Buffer = require("buffer").Buffer;
let encodedAuth = new Buffer(`${encodeURI(form?.username)}:${encodeURI(form?.password)}`).toString("base64");
const userInfo = await request.get("/auth/user", {
const result = await request.get("/auth/user", {
headers: { Authorization: `Basic ${encodedAuth}` },
});
console.log(userInfo);
userStore.updateUserInfo(result.data);
};

const handleLogin = async (ifNeedCookie: boolean = true) => {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Index = () => {
logOut();
};

console.warn("rendering home1");
// console.warn("rendering home1");

return (
<SafeAreaView className="flex-1 bg-[#2d363f]">
Expand Down Expand Up @@ -104,6 +104,7 @@ const Index = () => {
<View className="mt-4 flex-row">
{languageTags.map(each => (
<View
key={each}
// style={{ backgroundColor: "rgba(17,17,17,0.8)" }}
className="mr-3 rounded-full bg-[#111111] bg-opacity-80 px-3 py-1"
>
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4083,6 +4083,11 @@ image-size@^1.0.2:
dependencies:
queue "6.0.2"

immer@^10.0.3:
version "10.0.3"
resolved "https://registry.yarnpkg.com/immer/-/immer-10.0.3.tgz#a8de42065e964aa3edf6afc282dfc7f7f34ae3c9"
integrity sha512-pwupu3eWfouuaowscykeckFmVTpqbzW+rXFCX8rQLkZzM9ftBmU/++Ra+o+L27mz03zJTlyV4UUr+fdKNffo4A==

import-fresh@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546"
Expand Down

0 comments on commit ee5b02e

Please sign in to comment.