MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / checkForUpdates

Function checkForUpdates

main.js:8383–8433  ·  view source on GitHub ↗
(isBeta = false)

Source from the content-addressed store, hash-verified

8381 event.sender.send('thumbnail-added', {
8382 filePath: filePath,
8383 thumbnailCount: finalThumbnails.length,
8384 hasMultiple: finalThumbnails.length > 1,
8385 newImageIsDefault: true
8386 });
8387 }
8388 }
8389 }
8390 } catch (error) {
8391 console.error('Error adding image:', error);
8392 const win = BrowserWindow.fromWebContents(event.sender);
8393 if (win) {
8394 dialog.showMessageBox(win, {
8395 type: 'error',
8396 title: 'Error',
8397 message: 'Could not add image',
8398 detail: error.message
8399 });
8400 }
8401 }
8402 }
8403 });
8404 }
8405
8406 // Keep "Manage Thumbnails" visible in all modes for menu consistency.
8407 // It is only actionable for a single selected model.
8408 menuItems.push({
8409 label: 'Manage Thumbnails',
8410 enabled: filePaths.length === 1,
8411 click: async () => {
8412 if (filePaths.length !== 1) return;
8413 try {
8414 // Check if model has at least one thumbnail
8415 const storedThumbnail = readThumbnailColumn(filePaths[0]);
8416 const thumbnails = storedThumbnail ? parseThumbnails(storedThumbnail).filter(t => t && t !== '3d.png' && t.length > 0 && t.startsWith('data:image')) : [];
8417
8418 if (thumbnails.length === 0) {
8419 const win = BrowserWindow.fromWebContents(event.sender);
8420 if (win) {
8421 await dialog.showMessageBox(win, {
8422 type: 'info',
8423 title: 'No Thumbnails',
8424 message: 'This model has no thumbnails to manage.',
8425 detail: 'Please add an image first using "Add Image".'
8426 });
8427 }
8428 return;
8429 }
8430
8431 // Send event to renderer to show manage thumbnails modal
8432 if (isServerMode && global.broadcastEvent) {
8433 global.broadcastEvent('manage-thumbnails-request', filePaths[0]);
8434 } else {
8435 event.sender.send('manage-thumbnails-request', filePaths[0]);
8436 }

Callers 1

main.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected