kingkont 0.7.67 → 0.7.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/renderer/generate.js +7 -0
- package/renderer/settings.js +4 -0
package/package.json
CHANGED
package/renderer/generate.js
CHANGED
|
@@ -287,6 +287,13 @@ async function ensureApiKey(forKind) {
|
|
|
287
287
|
async function openGenModal(kind) {
|
|
288
288
|
if (!await ensureApiKey(kind)) return;
|
|
289
289
|
if (!state.currentBoard) return;
|
|
290
|
+
// Чистим стейт от прошлого regenerate'а (если юзер закрыл его modal через
|
|
291
|
+
// Esc, а не «Отмена» — глобальный Esc-handler не сбрасывает state).
|
|
292
|
+
// Без этого следующий submit принял бы текущую сессию за regenerate
|
|
293
|
+
// прошлой ноды и сгенерил бы туда вместо создания новой.
|
|
294
|
+
state.regenerateTarget = null;
|
|
295
|
+
state.pendingConnectionFrom = null;
|
|
296
|
+
state.sourceRef = null;
|
|
290
297
|
state.genKind = kind;
|
|
291
298
|
document.querySelectorAll('#genModal [data-kind]').forEach(b =>
|
|
292
299
|
b.classList.toggle('active', b.dataset.kind === kind));
|
package/renderer/settings.js
CHANGED
|
@@ -404,6 +404,10 @@ function closeAddMenuOnOutside(e) {
|
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
async function openGenerateForRef(fromNode, clientX, clientY, forceKind) {
|
|
407
|
+
// Чистим стейт от прошлого regenerate'а (см. комментарий в
|
|
408
|
+
// openGenModal — то же самое для anchor-drag flow).
|
|
409
|
+
state.regenerateTarget = null;
|
|
410
|
+
// pendingConnectionFrom выставится ниже, sourceRef — тоже.
|
|
407
411
|
// forceKind — если из anchor-drop меню юзер выбрал конкретный тип.
|
|
408
412
|
if (forceKind) {
|
|
409
413
|
if (!await ensureApiKey(forceKind)) return;
|