Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
11 changes: 8 additions & 3 deletions cypress/e2e/albums.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ describe('Manage albums', () => {
it('Edit an album\'s name', () => {
cy.get('[aria-label="Open actions menu"]').click()
cy.contains('Edit album details').click()
cy.get('form [name="name"]').clear().type('New name')
cy.get('form [name="name"]').clear()
cy.get('form [name="name"]').type('New name')
cy.contains('Save').click()

cy.contains('New name')
Expand All @@ -125,15 +126,19 @@ describe('Manage albums', () => {

cy.get('[aria-label="Open actions menu"]').click()
cy.contains('Edit album details').click()
cy.get('form [name="name"]').clear().type('albums_test')
cy.get('form [name="name"]').clear()
cy.get('form [name="name"]').type('albums_test')
cy.contains('Save').click()
})

it('Edit an album\'s location', () => {
cy.get('[aria-label="Open actions menu"]').click()
cy.contains('Edit album details').click()
cy.get('form [name="location"]').clear().type('New location')
cy.get('form [name="location"]').clear()
cy.get('form [name="location"]').type('New location')
cy.intercept({ times: 1, method: 'PROPPATCH', url: '/remote.php/dav/photos/*/albums/*' }).as('propPatchAlbum')
cy.contains('Save').click()
cy.wait('@propPatchAlbum')

cy.contains('New location')

Expand Down
2 changes: 1 addition & 1 deletion src/mixins/FetchFilesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default {
logger.error('Fail to create source directory', { error })
}
}
} else if (error.code === 'ERR_CANCELED') {
} else if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
} else {
this.errorFetchingFiles = error
Expand Down
6 changes: 3 additions & 3 deletions src/services/Albums.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export async function fetchAlbum(path, options, extraProps = '', client = defaul

return formatAlbum(response.data)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return null
}

Expand Down Expand Up @@ -110,7 +110,7 @@ export async function fetchAlbums(path, options, extraProps = '', client = defau
.filter(album => album.filename !== path)
.map(formatAlbum)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down Expand Up @@ -180,7 +180,7 @@ export async function fetchAlbumContent(path, options, client = defaultClient) {

return fetchedFiles
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down
6 changes: 3 additions & 3 deletions src/services/collectionFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export async function fetchCollection(path, options, extraProps = [], client = d

return formatCollection(response.data)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return null
}

Expand Down Expand Up @@ -146,7 +146,7 @@ export async function fetchCollections(path, options, extraProps = [], client =
.filter(collection => collection.filename !== path)
.map(formatCollection)
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down Expand Up @@ -217,7 +217,7 @@ export async function fetchCollectionFiles(path, options, extraProps = [], clien

return fetchedFiles
} catch (error) {
if (error.code === 'ERR_CANCELED') {
if (error instanceof DOMException && error.code === error.ABORT_ERR) {
return []
}

Expand Down
Loading