Auto-check platform image toggles when image is uploaded

include_image was always 0 because users had to manually tick the
per-platform image checkbox after uploading — not obvious. Now uploading
an image auto-checks all targets; users can still uncheck individually.

Also removes debug logging from dispatch-social.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bashy 2026-06-04 19:43:29 +03:00
parent b792535dd0
commit 24c9deef94
2 changed files with 2 additions and 4 deletions

View file

@ -213,10 +213,7 @@ foreach ($targets as $t) {
$with_image = (int)$t['include_image'] === 1 && $t['image_path'];
$image_path = $with_image ? ROOT . '/data/social-uploads/' . basename($t['image_path']) : null;
log_msg("post=$post_id target=$target_id platform=$platform key=$target_key"
. ($image_path ? ' +image' : '')
. " [include_image={$t['include_image']} db_path=" . ($t['image_path'] ?: 'NULL') . ']'
. ($image_path ? ' file_exists=' . (file_exists($image_path) ? 'yes' : 'NO') : ''));
log_msg("post=$post_id target=$target_id platform=$platform key=$target_key" . ($image_path ? ' +image' : ''));
if (!isset($configs[$pid])) $configs[$pid] = read_config($base);
$config = &$configs[$pid];

View file

@ -3933,6 +3933,7 @@ window.addEventListener('DOMContentLoaded', () => {
page.querySelectorAll('.social-img-cb, .social-img-cb + label').forEach(el => {
el.classList.toggle('d-none', !show);
});
if (show) page.querySelectorAll('.social-img-cb').forEach(cb => { cb.checked = true; });
}
function collectTargets() {