fix: always compare draft identity, gate auto-send until checked
Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
1 parent
e7deca480a
commit
57761326fd
7 files changed
+161
-34
No files matched your search
@@ -462,3 +462,17 @@ export function overLimit(text) {
|
||||
const length = typeof text === "string" ? text.length : 0;
|
||||
return Math.max(0, length - LIMITS.messageChars);
|
||||
}
|
||||
|
||||
/**
|
||||
* May the composer send on its own for this agent? Only after its draft and
|
||||
* the identity of its terminal were checked (see main.js `restoreDraft`): the
|
||||
* queue comes back from the disk before that, and an address can belong to a
|
||||
* different terminal now.
|
||||
*
|
||||
* @param {Set<string>|null} ready - the agents whose check is done
|
||||
* @param {string} key
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function canAutoSend(ready, key) {
|
||||
return ready instanceof Set && ready.has(key);
|
||||
}
|
||||
Reference in new issue
Block a user