Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
firebase
.firestore()
.collection("captions")
.doc(id)
);
const [name, setName] = React.useState(meta ? meta.get("title") : "");
const subcollection = firebase
.firestore()
.collection("captions")
.doc(id)
.collection("entries");
// load the actual captions themselves
const captions = useCollection(subcollection.orderBy("startTime"));
// the current video url
const [video, setVideo] = React.useState(
meta ? meta.get("url") : null
);
React.useEffect(() => {
if (meta && meta.get("url") !== video && meta.get("url")) {
setVideo(meta.get("url"));
}
if (meta && meta.get("title") !== name) {
setName(meta.get("title"));
}
}, [meta]);
export function useFollowRequests() {
const user = useSession();
const { error, loading, value } = useCollection(
firebase
.firestore()
.collection("relations")
.where("toUserId", "==", user.uid)
.where("confirmed", "==", false)
.limit(50)
);
return {
error,
loading,
value
};
}
const AppReviewViewContainer = ({ appsNeedingReview, submitReviewOfApp }) => {
const { state, dispatch } = useContext(SiteContext);
const { error, loading, value } = useCollection(appsNeedingReview);
const valueFetched = error || loading || !value ? "WAITING" : value.data();
let curAppReview =
state.curAppReview && state.curAppReview !== "SUBMITTED"
? state.curAppReview
: valueFetched;
const updateReviewInState = updatedReview =>
dispatch({ type: "UPDATE_APP_REVIEW", data: updatedReview });
const submitReviewInState = () => {
dispatch({ type: "SUBMIT_APP_REVIEW" });
submitReviewOfApp();
curAppReview = valueFetched;
};
return (
export const Me: React.FunctionComponent = props => {
const user = useSession();
const theme = useTheme();
const toast = useToast();
const [newProjectId, setNewProjectId] = React.useState();
const { error, loading, value } = useCollection(
firebase
.firestore()
.collection("captions")
.where("uid", "==", user!.uid)
);
const { loading: creatingProject, create } = useCreateProject();
function createProject() {
create()
.then(result => {
setNewProjectId(result.id);
})
.catch(err => {
toast({
title: "An error occurred while creating your project",