Giter Club home page Giter Club logo

Comments (6)

cerovcecblaze avatar cerovcecblaze commented on May 11, 2024 2

A potential solution is to use:

const uid = snapshot.docs[0].ref.path.split('/')[1];

and put that line^ and the rest of the code in that function in a try catch block. The line above will throw an error if there is no documents (posts), so for users where this throws an error, just catch, and do nothing since its pointless to get the posts of a user with no posts.

from instagramclone.

Elie-Bsaibes avatar Elie-Bsaibes commented on May 11, 2024

const uid = snapshot..query.C.path.segments[1];
For me the path was different from the one in the tutorial, so try this it might help

from instagramclone.

minhquan0902 avatar minhquan0902 commented on May 11, 2024

I think you should console.log(snapshot) for yourself and try to find the segments data based on the console.log, the snapshot data might be different because firebase might update their way to display the snapshot. For my part i was able to retrieve the data from snapshot..query.C.path.segments[1];

from instagramclone.

cliadaa avatar cliadaa commented on May 11, 2024

I'm facing the same issue when fetching userlikes (((snapshot.ZE.path.segments[3];))))), any solutions???

from instagramclone.

cliadaa avatar cliadaa commented on May 11, 2024

A potential solution is to use:

const uid = snapshot.docs[0].ref.path.split('/')[1];

and put that line^ and the rest of the code in that function in a try catch block. The line above will throw an error if there is no documents (posts), so for users where this throws an error, just catch, and do nothing since its pointless to get the posts of a user with no posts.

This worked for me when fetching user posts, any solution for user likes instead of snapshot.ZE.path.segments[3] ???

from instagramclone.

MQ-test avatar MQ-test commented on May 11, 2024

What does _C_ mean?
(I tried googling before posting).

from instagramclone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.