Fix empty image selection error for file-image interface (#18761)

* Fix empty image selection error for file-image interface

* Add changeset

* Update app/src/interfaces/file-image/file-image.vue

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
ian
2023-05-30 23:13:09 +08:00
committed by GitHub
parent 90f7674152
commit faca64db21
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Fixed empty image selection error for file-image interface

View File

@@ -80,7 +80,7 @@
<file-lightbox :id="image.id" v-model="lightboxActive" />
</div>
<v-upload v-else from-library from-url :from-user="createAllowed" :folder="folder" @input="update($event.id)" />
<v-upload v-else from-library from-url :from-user="createAllowed" :folder="folder" @input="onUpload" />
</div>
</template>
@@ -185,6 +185,10 @@ async function imageErrorHandler() {
}
}
function onUpload(image: any) {
if (image?.id) update(image.id);
}
function deselect() {
remove();