Skip to content

Commit f7ce708

Browse files
authored
Merge pull request frappe#2380 from raizasafeel/fix/bug
fix(settings): meta image uploads successfully
2 parents eaf7613 + bf83543 commit f7ce708

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

frontend/src/components/Settings/SettingFields.vue

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
v-if="!data[field.name]"
5050
:fileTypes="['image/*']"
5151
:validateFile="validateFile"
52-
@success="(file) => (data[field.name] = file)"
52+
@success="(file) => (data[field.name] = file.file_url)"
5353
>
5454
<template
5555
v-slot="{ file, progress, uploading, openFileSelector }"
@@ -70,23 +70,14 @@
7070
:class="field.size == 'lg' ? 'px-5 py-5' : 'px-20 py-8'"
7171
>
7272
<img
73-
:src="data[field.name]?.file_url || data[field.name]"
73+
:src="data[field.name]"
7474
class="rounded"
7575
:class="field.size == 'lg' ? 'w-36' : 'size-6'"
7676
/>
7777
</div>
7878
<div class="flex flex-col flex-wrap">
7979
<span class="break-all text-ink-gray-9">
80-
{{
81-
data[field.name]?.file_name ||
82-
data[field.name].split('/').pop()
83-
}}
84-
</span>
85-
<span
86-
v-if="data[field.name]?.file_size"
87-
class="text-sm text-ink-gray-5 mt-1"
88-
>
89-
{{ getFileSize(data[field.name]?.file_size) }}
80+
{{ data[field.name].split('/').pop() }}
9081
</span>
9182
</div>
9283
<X
@@ -105,7 +96,7 @@
10596
/>
10697
<!-- <div v-else>
10798
{{ data[field.name] }}
108-
99+
109100
</div> -->
110101
<FormControl
111102
v-else
@@ -127,8 +118,8 @@
127118
</template>
128119
<script setup>
129120
import { FormControl, FileUploader, Button, Switch } from 'frappe-ui'
130-
import { computed, onMounted, watch } from 'vue'
131-
import { getFileSize, validateFile } from '@/utils'
121+
import { onMounted, watch } from 'vue'
122+
import { validateFile } from '@/utils'
132123
import { X } from 'lucide-vue-next'
133124
import Link from '@/components/Controls/Link.vue'
134125
import CodeEditor from '@/components/Controls/CodeEditor.vue'

0 commit comments

Comments
 (0)