-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Also add current folder to button factory #1351
Conversation
@@ -189,7 +190,7 @@ const viewHeadline = computed(() => currentView.value === 'favorites' ? t('Favor | |||
/** | |||
* All currently selected files | |||
*/ | |||
const selectedFiles = ref<Node[]>([]) | |||
const selectedFiles = shallowReactive<Node[]>([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a shallow reactive, meaning the array is reactive, but not the inner elements.
This is required to fix Typescript, as Vue unrefs the inner nodes for ref
which will strip off any private properties of the Node type. This causes Typescript issues as the types Ref<Node>.value != Node
.
const navigatedPath = ref<string>() | ||
const navigatedPath = ref('') | ||
// Save the navigated path to the session storage on change | ||
watch([navigatedPath], () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the writable computed below we can simply watch this and then react to it. Because doing login in writable computed properties seems to be bad.
50adb46
to
000938d
Compare
@@ -114,7 +114,15 @@ export const useDAVFiles = function( | |||
/** | |||
* All files in current view and path | |||
*/ | |||
const files = ref<Node[]>([] as Node[]) as Ref<Node[]> | |||
const files = shallowRef<Node[]>([] as Node[]) as Ref<Node[]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same reason as for the shallowReactive
but here we can use shallowRef
because it only needs to be reactive on change of the value, we do not change the array.
000938d
to
70b3e6b
Compare
…`allowPickDirectory` is true Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
70b3e6b
to
110ddce
Compare
Signed-off-by: Ferdinand Thiessen <[email protected]>
When picking directories and no node is selected the current directory is picked, this is correctly submitted but it is currently not correctly included in the button factory.
Meaning you can for example not check if you can pick the current directory (readonly directory).
Required for nextcloud/server#45688