Skip to content

Commit

Permalink
Merge branch 'narayan954:master' into post-UI-improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Tisha6661 authored Jul 9, 2023
2 parents 72c40a3 + 2539f7d commit 4846d27
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/Post/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Post(prop) {
snapshot.docs.map((doc) => ({
id: doc.id,
content: doc.data(),
}))
})),
);
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function handleMultiUpload(files, options = {}) {
onUploadProgress: (_percentage) => {},
generateThumbnails: false,
},
options
options,
);

let totalSize = 0;
Expand Down Expand Up @@ -71,7 +71,7 @@ function handleMultiUpload(files, options = {}) {
lastUploadedSize = snapshot.bytesTransferred;

_options.onUploadProgress(
Math.round((totalUploaded / totalSize) * 100)
Math.round((totalUploaded / totalSize) * 100),
);
},
(error) => {
Expand Down Expand Up @@ -129,7 +129,7 @@ function handleMultiUpload(files, options = {}) {
.catch((error) => {
reject(error);
});
}
},
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/PostView/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PostView = (props) => {
const [post, setPost] = useState(null);
const [loading, setLoading] = useState(true);
const [fetchAgain, setFetchAgain] = useState(false);

useEffect(() => {
setLoading(true);
if (loading) {
Expand Down
13 changes: 6 additions & 7 deletions src/pages/Profile/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ function Profile() {
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [avatar, setAvatar] = useState("");

let uid = location?.state?.uid || user?.uid;
const [uid, setUid] = useState(location?.state?.uid || null);

const handleClose = () => setOpen(false);

Expand Down Expand Up @@ -150,9 +149,9 @@ function Profile() {
setEmail(
location?.state?.name === authUser?.displayName
? location?.state?.email || authUser.email
: ""
: "",
);
uid = location?.state?.uid || authUser.uid;
setUid(location?.state?.uid || authUser.uid);
} else {
navigate("/dummygram/login");
}
Expand All @@ -167,7 +166,7 @@ function Profile() {
useEffect(() => {
const usernameQ = query(
collection(db, "users"),
where("uid", "==", auth.currentUser.uid)
where("uid", "==", auth.currentUser.uid),
);
const unsubscribe = onSnapshot(usernameQ, (querySnapshot) => {
querySnapshot.forEach((doc) => {
Expand All @@ -180,7 +179,7 @@ function Profile() {
useEffect(() => {
const q = query(
collection(db, "posts"),
where("username", "==", location?.state?.name || name)
where("username", "==", location?.state?.name || name),
);
const unsubscribe = onSnapshot(q, (querySnapshot) => {
const userPosts = [];
Expand Down Expand Up @@ -233,7 +232,7 @@ function Profile() {
variant: "success",
});
});
}
},
);
setVisible(false);
};
Expand Down

0 comments on commit 4846d27

Please sign in to comment.