Skip to content

Commit 01498c6

Browse files
dependabot[bot]susnux
authored andcommitted
build(deps): Bump @nextcloud/files from 4.0.0-beta.4 to 4.0.0-beta.5
Bumps [@nextcloud/files](https://github.com/nextcloud-libraries/nextcloud-files) from 4.0.0-beta.4 to 4.0.0-beta.5. - [Release notes](https://github.com/nextcloud-libraries/nextcloud-files/releases) - [Changelog](https://github.com/nextcloud-libraries/nextcloud-files/blob/main/CHANGELOG.md) - [Commits](nextcloud-libraries/nextcloud-files@v4.0.0-beta.4...v4.0.0-beta.5) --- updated-dependencies: - dependency-name: "@nextcloud/files" dependency-version: 4.0.0-beta.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
1 parent 9abcafb commit 01498c6

File tree

4 files changed

+56
-36
lines changed

4 files changed

+56
-36
lines changed

apps/files/src/composables/useNavigation.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Composables: useNavigation', () => {
4141
it('should return already active navigation', async () => {
4242
const view = new nextcloudFiles.View({ getContents: () => Promise.reject(new Error()), icon: '<svg></svg>', id: 'view-1', name: 'My View 1', order: 0 })
4343
navigation.register(view)
44-
navigation.setActive(view)
44+
navigation.setActive(view.id)
4545
// Now the navigation is already set it should take the active navigation
4646
const wrapper = mount(TestComponent)
4747
expect((wrapper.vm as unknown as { currentView: View | null }).currentView).toBe(view)
@@ -55,7 +55,7 @@ describe('Composables: useNavigation', () => {
5555
// no active navigation
5656
expect((wrapper.vm as unknown as { currentView: View | null }).currentView).toBe(null)
5757

58-
navigation.setActive(view)
58+
navigation.setActive(view.id)
5959
// Now the navigation is set it should take the active navigation
6060
expect((wrapper.vm as unknown as { currentView: View | null }).currentView).toBe(view)
6161
})

apps/files_sharing/src/init-public.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { Folder } from '@nextcloud/files'
2-
/**
1+
/*!
32
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
43
* SPDX-License-Identifier: AGPL-3.0-or-later
54
*/
5+
6+
import type { Folder } from '@nextcloud/files'
67
import type { ShareAttribute } from './sharing.d.ts'
78

89
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
@@ -22,7 +23,12 @@ registerPublicFileShareView()
2223
// Get the current view from state and set it active
2324
const view = loadState<string>('files_sharing', 'view')
2425
const navigation = getNavigation()
25-
navigation.setActive(navigation.views.find(({ id }) => id === view) ?? null)
26+
try {
27+
navigation.setActive(view)
28+
} catch {
29+
// no such view
30+
navigation.setActive(null)
31+
}
2632

2733
// Force our own router
2834
window.OCP.Files = window.OCP.Files ?? {}

0 commit comments

Comments
 (0)