mirror of
https://github.com/wasrusgen/zashita-brandbook.git
synced 2026-06-03 15:44:47 +00:00
fix: SyntaxError in _buildCTData (mixed quotes), _chatHistory race condition
This commit is contained in:
parent
99be1f7019
commit
534ad8fdcd
17
mockup.html
17
mockup.html
@ -3974,7 +3974,7 @@ window.addEventListener('DOMContentLoaded', checkReturning);
|
|||||||
status: 'active',
|
status: 'active',
|
||||||
quality: c.quality, // оценка качества если есть
|
quality: c.quality, // оценка качества если есть
|
||||||
deadlines_count: c.deadlines_count || 0,
|
deadlines_count: c.deadlines_count || 0,
|
||||||
go: "toast('📄 Открываю дело: " + name.replace(/'/g,''') + "')"
|
go: "_openRealCase(" + i + ")"
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -4118,6 +4118,12 @@ window.addEventListener('DOMContentLoaded', checkReturning);
|
|||||||
render();
|
render();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window._openRealCase = function(i) {
|
||||||
|
var c = (_getContracts() || [])[i];
|
||||||
|
if (!c) return;
|
||||||
|
toast('📄 ' + (c.type || 'Договор') + (c.counterparty ? ' · ' + c.counterparty : ''));
|
||||||
|
};
|
||||||
|
|
||||||
// Рендер при открытии вкладки cases и cabinet
|
// Рендер при открытии вкладки cases и cabinet
|
||||||
var _origTab2 = window.tab;
|
var _origTab2 = window.tab;
|
||||||
window.tab = function(id) {
|
window.tab = function(id) {
|
||||||
@ -7289,10 +7295,13 @@ function _compressAsync(showToast) {
|
|||||||
.catch(function(){});
|
.catch(function(){});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Флаг памяти — используется для контекстного приветствия
|
// Флаг памяти — используется для контекстного приветствия (с защитой от race condition)
|
||||||
window._hasMemory = (function() {
|
window._hasMemory = (function() {
|
||||||
var h = _chatHistory.length, c = _getContracts().length;
|
try {
|
||||||
return (h || c) ? { messages: h, contracts: c, hasDossier: !!_getDossier() } : null;
|
var h = (typeof _chatHistory !== 'undefined' ? _chatHistory.length : 0);
|
||||||
|
var c = (typeof _getContracts === 'function' ? _getContracts().length : 0);
|
||||||
|
return (h || c) ? { messages: h, contracts: c, hasDossier: !!(typeof _getDossier === 'function' && _getDossier()) } : null;
|
||||||
|
} catch(e) { return null; }
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body></html>
|
</body></html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user