Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Grok-Enhancer.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3510,7 +3510,17 @@
const now = Date.now();
if (now - _ge_imLastModScan < 400) return;
_ge_imLastModScan = now;
if (!ge_findModerationSignal()) return;
if (!ge_findModerationSignal()) {
// Reset retry counter when moderation clears (new generation succeeded or
// user started fresh) so subsequent prompts can retry from zero again.
// Guard with a cooldown to avoid resetting during the brief gap between
// a retry click and the moderation signal reappearing.
if (ge_imRetryCount > 0 && now - ge_imLastRetryTime > 5000) {
ge_imRetryCount = 0;
ge_updateImStatus();
}
return;
}

const btn = document.querySelector('button[aria-label="Make video"]')
|| document.querySelector('button[aria-label="Send"]')
Expand Down Expand Up @@ -4283,11 +4293,11 @@
const retRow = document.createElement('div'); retRow.className = 'im-row';
const retLbl = document.createElement('span'); retLbl.className = 'im-lbl'; retLbl.textContent = 'Max Retries';
const retInp = document.createElement('input');
retInp.type = 'number'; retInp.min = '1'; retInp.max = '20'; retInp.value = ge_imMaxRetries;
retInp.type = 'number'; retInp.min = '1'; retInp.max = '50'; retInp.value = ge_imMaxRetries;
retInp.style.cssText = 'width:42px;padding:2px 4px;background:#222;color:#fff;border:1px solid #444;border-radius:4px;font-size:11px;text-align:center;';
retInp.addEventListener('change', () => {
const v = parseInt(retInp.value);
if (v >= 1 && v <= 20) { ge_imMaxRetries = v; setState('GrokEnhancer_IM_MaxRetries', v); }
if (v >= 1 && v <= 50) { ge_imMaxRetries = v; setState('GrokEnhancer_IM_MaxRetries', v); }
});
retRow.appendChild(retLbl); retRow.appendChild(retInp);
section.appendChild(retRow);
Expand Down