Skip to content

Commit

Permalink
fix: use correct feed items
Browse files Browse the repository at this point in the history
  • Loading branch information
pbek committed May 24, 2024
1 parent 16279ac commit 9d4d6c0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/components/feed-display/FeedItemDisplayList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,6 @@ export default Vue.extend({
cfg() {
return _.defaults({ ...this.config }, DEFAULT_DISPLAY_LIST_CONFIG)
},
allItems() {
return this.$store.getters.allItems
},
selectedItem() {
return this.$store.getters.selected
},
Expand Down Expand Up @@ -193,10 +190,10 @@ export default Vue.extend({
// TODO: Make jumpToPreviousItem() set MARK_READ if needed
jumpToPreviousItem() {
console.log('Previous item')

Check warning on line 192 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint node

Unexpected console statement

Check warning on line 192 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
const currentIndex = this.selectedItem ? this.allItems.findIndex((item: FeedItem) => item.id === this.selectedItem.id) || 0 : 0
const currentIndex = this.selectedItem ? this.items.findIndex((item: FeedItem) => item.id === this.selectedItem.id) || 0 : 0
console.log('currentIndex', currentIndex)

Check warning on line 194 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint node

Unexpected console statement

Check warning on line 194 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
if (currentIndex > 0) {
const previousItem = this.allItems[currentIndex - 1]
const previousItem = this.items[currentIndex - 1]
console.log('previousItem', previousItem)

Check warning on line 197 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint node

Unexpected console statement

Check warning on line 197 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
this.$store.commit(MUTATIONS.SET_SELECTED_ITEM, { id: previousItem.id })
// this.$store.dispatch(ACTIONS.MARK_READ, { previousItem })
Expand All @@ -207,10 +204,10 @@ export default Vue.extend({
// TODO: Make jumpToNextItem() set MARK_READ if needed
jumpToNextItem() {
console.log('Next item')

Check warning on line 206 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint node

Unexpected console statement

Check warning on line 206 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
const currentIndex = this.selectedItem ? this.allItems.findIndex((item: FeedItem) => item.id === this.selectedItem.id) || 0 : 0
const currentIndex = this.selectedItem ? this.items.findIndex((item: FeedItem) => item.id === this.selectedItem.id) || 0 : 0
console.log('currentIndex', currentIndex)

Check warning on line 208 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint node

Unexpected console statement

Check warning on line 208 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
if (currentIndex !== -1 && currentIndex < this.allItems.length - 1) {
const nextItem = this.allItems[currentIndex + 1]
if (currentIndex !== -1 && currentIndex < this.items.length - 1) {
const nextItem = this.items[currentIndex + 1]
console.log('nextItem', nextItem)

Check warning on line 211 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint node

Unexpected console statement

Check warning on line 211 in src/components/feed-display/FeedItemDisplayList.vue

View workflow job for this annotation

GitHub Actions / eslint

Unexpected console statement
this.$store.commit(MUTATIONS.SET_SELECTED_ITEM, { id: nextItem.id })
// this.$store.dispatch(ACTIONS.MARK_READ, { nextItem })
Expand Down

0 comments on commit 9d4d6c0

Please sign in to comment.