Remove debug console logs
This commit is contained in:
parent
6613de5af9
commit
60f2635e21
|
@ -122,7 +122,6 @@ const memoryCache = new InMemoryCache({
|
||||||
media: {
|
media: {
|
||||||
keyArgs: ['onlyFavorites'],
|
keyArgs: ['onlyFavorites'],
|
||||||
merge(existing = [], incoming) {
|
merge(existing = [], incoming) {
|
||||||
console.log('merge media', existing, incoming)
|
|
||||||
return [...existing, ...incoming]
|
return [...existing, ...incoming]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,17 +19,14 @@ const useScrollPagination = ({ loading, fetchMore, data, getItems }) => {
|
||||||
|
|
||||||
// configure new observer
|
// configure new observer
|
||||||
observer.current = new IntersectionObserver(entities => {
|
observer.current = new IntersectionObserver(entities => {
|
||||||
console.log('Observing', entities)
|
|
||||||
if (entities.find(x => x.isIntersecting == false)) {
|
if (entities.find(x => x.isIntersecting == false)) {
|
||||||
let itemCount = getItems(data).length
|
let itemCount = getItems(data).length
|
||||||
console.log('load more', itemCount)
|
|
||||||
fetchMore({
|
fetchMore({
|
||||||
variables: {
|
variables: {
|
||||||
offset: itemCount,
|
offset: itemCount,
|
||||||
},
|
},
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
const newItemCount = getItems(result.data).length
|
const newItemCount = getItems(result.data).length
|
||||||
console.log('then', result, itemCount, newItemCount)
|
|
||||||
if (newItemCount == 0) {
|
if (newItemCount == 0) {
|
||||||
setFinished(true)
|
setFinished(true)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue