Skip image upload step when items have remote image URLs
Items from Toast menus have CDN URLs (https://img.cdn4dd.com/...) which saveWizard.cfm will download automatically. No need to prompt user to upload images when remote URLs are already present. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c5b678ac05
commit
91c34d120f
1 changed files with 15 additions and 2 deletions
|
|
@ -1508,9 +1508,22 @@
|
||||||
// Remove loading message and start conversation flow
|
// Remove loading message and start conversation flow
|
||||||
document.getElementById('conversation').innerHTML = '';
|
document.getElementById('conversation').innerHTML = '';
|
||||||
|
|
||||||
// Check if any items have imageUrl - if so, offer image upload matching
|
// Check if items have imageUrl - skip upload step if they're remote URLs (will be downloaded by saveWizard)
|
||||||
const itemsWithImages = (config.extractedData.items || []).filter(item => item.imageUrl).length;
|
const itemsWithImages = (config.extractedData.items || []).filter(item => item.imageUrl).length;
|
||||||
if (itemsWithImages > 0) {
|
const itemsWithRemoteImages = (config.extractedData.items || []).filter(item =>
|
||||||
|
item.imageUrl && (item.imageUrl.startsWith('http://') || item.imageUrl.startsWith('https://'))
|
||||||
|
).length;
|
||||||
|
|
||||||
|
if (itemsWithRemoteImages > 0) {
|
||||||
|
// Items have remote image URLs - saveWizard will download them, skip upload step
|
||||||
|
console.log(`${itemsWithRemoteImages} items have remote image URLs - skipping upload step`);
|
||||||
|
if (config.businessId && config.menuId) {
|
||||||
|
showCategoriesStep();
|
||||||
|
} else {
|
||||||
|
showBusinessInfoStep();
|
||||||
|
}
|
||||||
|
} else if (itemsWithImages > 0) {
|
||||||
|
// Items have local image refs (Menu_files/) - show upload step
|
||||||
showImageMatchingStep();
|
showImageMatchingStep();
|
||||||
} else if (config.businessId && config.menuId) {
|
} else if (config.businessId && config.menuId) {
|
||||||
// In add-menu mode, skip business info and header
|
// In add-menu mode, skip business info and header
|
||||||
|
|
|
||||||
Reference in a new issue