Skip to content

Commit a2878a1

Browse files
committed
fix 23
1 parent b0fe6e1 commit a2878a1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

js/mood-palette.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ function emailPalette() {
396396
const payload = {
397397
message: `Please send this color palette to the user's email. Palette colors: ${paletteDescription}`,
398398
useLLM: true,
399-
wantsR1Response: true
399+
wantsR1Response: true // Set to true to have R1 speak the response
400400
};
401401

402402
PluginMessageHandler.postMessage(JSON.stringify(payload));
@@ -456,7 +456,16 @@ window.onPluginMessage = function(data) {
456456
showStatus(data.data, 'info');
457457
}
458458
} else if (data.message) {
459-
showStatus(data.message, 'info');
459+
// Handle email response
460+
if (data.message.includes('sent') || data.message.includes('email')) {
461+
showStatus('PALETTE SENT TO YOUR EMAIL!', 'success');
462+
// Reset after success
463+
setTimeout(() => {
464+
resetApp();
465+
}, 2000);
466+
} else {
467+
showStatus(data.message, 'info');
468+
}
460469
} else {
461470
// Show raw data if no message or data
462471
showStatus('RECEIVED: ' + JSON.stringify(data), 'info');
@@ -490,7 +499,8 @@ async function fallbackToCatboxAnalysis() {
490499
// Send image URL to LLM for analysis
491500
const payload = {
492501
message: `Please analyze the colors in this image and provide exactly 5 dominant colors in hex format. Response format: {"colors": ["#hex1", "#hex2", "#hex3", "#hex4", "#hex5"]}. Image URL: ${imageUrl}`,
493-
useLLM: true
502+
useLLM: true,
503+
wantsR1Response: false // Set to false to get JSON response
494504
};
495505

496506
console.log('Sending to LLM:', payload.message);

0 commit comments

Comments
 (0)