jebin2 commited on
Commit
92d2792
·
1 Parent(s): dbc0277
Files changed (1) hide show
  1. image/javascript/image.js +4 -2
image/javascript/image.js CHANGED
@@ -185,13 +185,15 @@ function renderFileCards() {
185
  filesGrid.innerHTML = selectedFiles.map(file => {
186
  // Find completed file data for download URL
187
  const completedFile = completedFiles.find(cf => cf.id === file.id);
 
 
188
 
189
  return `
190
  <div class="file-card" id="file-${file.id}">
191
  <button class="remove-button" onclick="removeFile('${file.id}')">×</button>
192
- ${window.location.pathname == '/image/remove_metadata' && file.other_info ? `<button class="remove-button" style="top: 40px; background: #17a2b8;" onclick="showMetadata('${file.id}')">i</button>` : ``}
193
  ${file.status === 'error' && file.errorMessage ? `<button class="remove-button" style="top: 40px; background: #dc3545;" onclick="showError('${file.id}')" title="View error">!</button>` : ``}
194
- ${file.status === 'completed' && completedFile ? `<button class="remove-button" style="top: ${file.other_info ? '70px' : '40px'}; background: #28a745;" onclick="downloadFile('${file.id}')" title="Download">⬇</button>` : ``}
195
 
196
  <div class="file-preview">
197
  ${file.preview ? `<img src="${file.preview}" alt="${file.name}">` : '<span class="file-icon">🖼️</span>'}
 
185
  filesGrid.innerHTML = selectedFiles.map(file => {
186
  // Find completed file data for download URL
187
  const completedFile = completedFiles.find(cf => cf.id === file.id);
188
+ // Check if metadata info exists and has content
189
+ const hasMetadata = file.other_info && Object.keys(file.other_info).length > 0;
190
 
191
  return `
192
  <div class="file-card" id="file-${file.id}">
193
  <button class="remove-button" onclick="removeFile('${file.id}')">×</button>
194
+ ${window.location.pathname == '/image/remove_metadata' && file.status === 'completed' ? `<button class="remove-button" style="top: 40px; background: #17a2b8;" onclick="showMetadata('${file.id}')" title="View removed metadata">i</button>` : ``}
195
  ${file.status === 'error' && file.errorMessage ? `<button class="remove-button" style="top: 40px; background: #dc3545;" onclick="showError('${file.id}')" title="View error">!</button>` : ``}
196
+ ${file.status === 'completed' && completedFile ? `<button class="remove-button" style="top: ${window.location.pathname == '/image/remove_metadata' ? '70px' : '40px'}; background: #28a745;" onclick="downloadFile('${file.id}')" title="Download">⬇</button>` : ``}
197
 
198
  <div class="file-preview">
199
  ${file.preview ? `<img src="${file.preview}" alt="${file.name}">` : '<span class="file-icon">🖼️</span>'}