Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/slideshow/slideshowPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export const slideshowPane = {
label: function (subject, context) {
const store = context.session.store
if (solidLogicSingleton.resource.isContainer(subject)) {
const contents = store.each(subject, ns.ldp('contains'))
const images = getImageContents(subject, store)
return new Set(images.map(image => image.uri)).size > 1 && images.length === contents.length ? 'Slideshow' : null
return new Set(images.map(image => image.uri)).size > 1 ? 'Slideshow' : null
}
return null
},
Expand Down
7 changes: 4 additions & 3 deletions test/unit/slideshowPane.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ describe('slideshow pane', () => {
expect(slideshowPane.label(subject as any, context)).toBeNull()
})

it('rejects containers containing non-image resources', () => {
it('accepts containers containing multiple images and other resources', () => {
const { subject, context } = contextFor([
{ uri: 'one.png', image: true },
{ uri: 'notes.txt', image: false }
{ uri: 'notes.txt', image: false },
{ uri: 'two.png', image: true }
])

expect(slideshowPane.label(subject as any, context)).toBeNull()
expect(slideshowPane.label(subject as any, context)).toBe('Slideshow')
})

it('accepts containers containing multiple images only', () => {
Expand Down
Loading