Fix automatic gallery refresh after image import

- Changed updateImageGalleryControls() to loadImageGallery() in import handlers
- Now gallery refreshes automatically after importing task or consequence images
- Also fixed scan button to refresh gallery after directory scanning
- No more need to navigate away and back to see newly imported images

Gallery now updates immediately showing:
- Newly imported images in the correct category tabs
- Updated image counts and selections
- Real-time visual feedback for successful imports
This commit is contained in:
fritzsenpai 2025-09-25 20:21:07 -05:00
parent 45adf1b757
commit ba4e532322
2 changed files with 3 additions and 3 deletions

View File

@ -947,7 +947,7 @@ class TaskChallengeGame {
newImportTaskBtn.addEventListener('click', async () => {
if (this.fileManager) {
await this.fileManager.selectAndImportImages('task');
this.updateImageGalleryControls('task');
this.loadImageGallery(); // Refresh the gallery to show new images
} else {
this.showNotification('Desktop file manager not available', 'warning');
}
@ -960,7 +960,7 @@ class TaskChallengeGame {
newImportConsequenceBtn.addEventListener('click', async () => {
if (this.fileManager) {
await this.fileManager.selectAndImportImages('consequence');
this.updateImageGalleryControls('consequence');
this.loadImageGallery(); // Refresh the gallery to show new images
} else {
this.showNotification('Desktop file manager not available', 'warning');
}
@ -994,7 +994,7 @@ class TaskChallengeGame {
if (this.fileManager) {
// Use desktop file manager scanning
await this.fileManager.scanAllDirectories();
this.updateImageGalleryControls('task');
this.loadImageGallery(); // Refresh the gallery to show scanned images
} else {
// Fallback to web scanning
this.scanForNewImages();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB