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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/viewer-main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* extracted by css-entry-points-plugin */
@import './main-D1HzHdhz.chunk.css';
@import './main-labEDf3j.chunk.css';
@import './previewUtils-CU5qdRbf.chunk.css';
2 changes: 1 addition & 1 deletion js/viewer-main.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.mjs.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions playwright/e2e/actions/sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ import {

test.describe.serial('Open the sidebar from the viewer and open viewer with sidebar already opened', () => {
let page: Page
const pageErrors: string[] = []

test.beforeAll(async ({ browser }) => {
({ page } = await setupFilesPage(browser, [1, 2, 3, 4].map((i) => ({
fixture: `image${i}.jpg`,
mimeType: 'image/jpeg',
}))))
page.on('pageerror', (error) => pageErrors.push(error.message))
})

test.afterAll(async () => {
Expand Down Expand Up @@ -103,4 +105,10 @@ test.describe.serial('Open the sidebar from the viewer and open viewer with side
await expect(getSidebar(page)).not.toBeVisible()
await expect(getMenuToggle(page)).toBeVisible()
})

test('Close the viewer without errors', async () => {
await getCloseButton(page).click()
await expect(getViewer(page)).toHaveCount(0)
expect(pageErrors).toEqual([])
})
})
4 changes: 2 additions & 2 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ export default defineComponent({
// which then triggers cleanup.
OCA.Viewer.close()

if (OCA?.Files?.Sidebar) {
if (typeof OCA?.Files?.Sidebar?.setFullScreenMode === 'function') {
OCA.Files.Sidebar.setFullScreenMode(false)
}

Expand Down Expand Up @@ -1192,7 +1192,7 @@ export default defineComponent({

// some apps mocked the files api to allow their sidebar to be used with the viewer
// to not break them keep this at least until Nextcloud 34.
if (OCA?.Files?.Sidebar) {
if (typeof OCA?.Files?.Sidebar?.open === 'function') {
// TODO: also hide figure, needs a proper method for it in server Sidebar
await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)
}
Expand Down
Loading