@adminforth/upload 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.log CHANGED
@@ -11,5 +11,5 @@ custom/preview.vue
11
11
  custom/tsconfig.json
12
12
  custom/uploader.vue
13
13
 
14
- sent 51,379 bytes received 134 bytes 103,026.00 bytes/sec
15
- total size is 50,890 speedup is 0.99
14
+ sent 51,375 bytes received 134 bytes 103,018.00 bytes/sec
15
+ total size is 50,893 speedup is 0.99
@@ -171,7 +171,11 @@ onMounted(async () => {
171
171
  const existingFilePath =
172
172
  typeof existingValue === 'string' && existingValue.trim() ? existingValue : null;
173
173
 
174
- if (!uploaded.value && existingFilePath) {
174
+ if (!uploaded.value && props.record?.[previewColumnName]) {
175
+ imgPreview.value = props.record[previewColumnName];
176
+ uploaded.value = true;
177
+ emit('update:emptiness', false);
178
+ } else if (!uploaded.value && existingFilePath) {
175
179
  const resp = await callAdminForthApi({
176
180
  path: `/plugin/${props.meta.pluginInstanceId}/get-file-download-url`,
177
181
  method: 'POST',
@@ -186,11 +190,6 @@ onMounted(async () => {
186
190
  }
187
191
  }
188
192
 
189
- if (!uploaded.value && props.record?.[previewColumnName]) {
190
- imgPreview.value = props.record[previewColumnName];
191
- uploaded.value = true;
192
- emit('update:emptiness', false);
193
- }
194
193
  });
195
194
 
196
195
  const allowedExtensionsLabel = computed(() => {
@@ -171,7 +171,11 @@ onMounted(async () => {
171
171
  const existingFilePath =
172
172
  typeof existingValue === 'string' && existingValue.trim() ? existingValue : null;
173
173
 
174
- if (!uploaded.value && existingFilePath) {
174
+ if (!uploaded.value && props.record?.[previewColumnName]) {
175
+ imgPreview.value = props.record[previewColumnName];
176
+ uploaded.value = true;
177
+ emit('update:emptiness', false);
178
+ } else if (!uploaded.value && existingFilePath) {
175
179
  const resp = await callAdminForthApi({
176
180
  path: `/plugin/${props.meta.pluginInstanceId}/get-file-download-url`,
177
181
  method: 'POST',
@@ -186,11 +190,6 @@ onMounted(async () => {
186
190
  }
187
191
  }
188
192
 
189
- if (!uploaded.value && props.record?.[previewColumnName]) {
190
- imgPreview.value = props.record[previewColumnName];
191
- uploaded.value = true;
192
- emit('update:emptiness', false);
193
- }
194
193
  });
195
194
 
196
195
  const allowedExtensionsLabel = computed(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/upload",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Plugin for uploading files for adminforth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",