Skip to content
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(FilePicker): cropImagePreviews is now provided as a prop in FilePreview #1120

Merged
merged 1 commit into from
Nov 23, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/components/FilePicker/FileListRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const props = defineProps<{
/** The current node */
node: Node
/** Whether the preview should be cropped */
cropImagePreviews: Boolean
cropImagePreviews: boolean
}>()

const emit = defineEmits<{
Expand Down
4 changes: 2 additions & 2 deletions lib/components/FilePicker/FilePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const fileListIconStyles = ref(fileListIconStylesModule)

const props = defineProps<{
node: Node
cropImagePreviews: Boolean
cropImagePreviews: boolean
}>()

const previewURL = computed(() => getPreviewURL(props.node, { cropPreview: cropImagePreviews.value }))
const previewURL = computed(() => getPreviewURL(props.node, { cropPreview: props.cropImagePreviews }))

const isFile = computed(() => props.node.type === FileType.File)
const canLoadPreview = ref(false)
Expand Down
8 changes: 5 additions & 3 deletions lib/composables/filesSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import type { ComputedRef, Ref } from 'vue'

import { loadState } from '@nextcloud/initial-state'
import { computed, ref, type ComputedRef, type Ref } from 'vue'
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
import { toValue } from '@vueuse/core'
import { onMounted } from 'vue'
import { computed, onMounted, ref } from 'vue'

import axios from '@nextcloud/axios'

interface OCAFilesUserConfig {
show_hidden: boolean
Expand Down