#firebase database Get data

12 messages · Page 1 of 1 (latest)

deep fox
#

´´´ if(lastVisible < this.count){
const next = query(ref(db, "vids"),orderByChild('ts','desc'),startAfter(lastVisible),limitToFirst(2));
get(next).then((snapshot =>{
var val = Object.values(snapshot.val())
val.forEach(element => {
if(!this.links.includes(element)){
this.links.push(element)
console.log(this.links)
}else{console.log('it alredy exsists')}

  });
  lastVisible += Object.keys(snapshot.val()).length
}))}else{console.log('no vidoe left')}´´´
#

So when i spamclick the button that runs this

#

it still loads the data that alredy exsits

#

even thought i first check

#

Guys i fixed it

#

i just disabled it

#

then enabled it back

light axle
#

Try some of these solutions

deep fox
#

thanks

#

@light axle Thanks, i fixed by putting firebase in dependenciys i dont know why it wasnt there! it was for netfily