Skip to content

Commit 41f1bd4

Browse files
Copilotmiaulalala
authored andcommitted
fix(theming): backport missing FileInputField cache key update
Agent-Logs-Url: https://github.com/nextcloud/server/sessions/3691de2e-c43a-4f08-b101-79cfe030dfa7 Co-authored-by: miaulalala <7427347+miaulalala@users.noreply.github.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent 4a76d83 commit 41f1bd4

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

apps/theming/src/components/admin/FileInputField.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
:class="{
4646
'field__preview--logoheader': name === 'logoheader',
4747
'field__preview--favicon': name === 'favicon',
48-
}" />
48+
}"
49+
:style="previewStyle" />
4950

5051
<NcNoteCard v-if="errorMessage"
5152
type="error"
@@ -124,6 +125,7 @@ export default {
124125
data() {
125126
return {
126127
showLoading: false,
128+
cacheKey: Date.now(),
127129
acceptMime: (allowedMimeTypes[this.name]
128130
|| ['image/jpeg', 'image/png', 'image/gif', 'image/webp']).join(','),
129131
}
@@ -145,6 +147,13 @@ export default {
145147
}
146148
return false
147149
},
150+
151+
previewStyle() {
152+
const url = generateUrl('/apps/theming/image/{key}', { key: this.name })
153+
return {
154+
backgroundImage: `url(${url}?v=${this.cacheKey}&m=${encodeURIComponent(this.mimeValue)})`,
155+
}
156+
},
148157
},
149158
150159
methods: {
@@ -167,6 +176,7 @@ export default {
167176
this.showLoading = true
168177
const { data } = await axios.post(url, formData)
169178
this.showLoading = false
179+
this.cacheKey = Date.now()
170180
this.$emit('update:mime-value', file.type)
171181
this.$emit('uploaded', data.data.url)
172182
this.handleSuccess()

dist/theming-admin-theming.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/theming-admin-theming.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)