Changeset 0.15.0 (#71)
This commit is contained in:
@@ -52,6 +52,26 @@ async function summarizeAndContinue() {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Per-Channel Auto-Compaction Toggle ──────
|
||||
|
||||
async function toggleChannelAutoCompact(enabled) {
|
||||
const chatId = App.currentChatId;
|
||||
if (!chatId) return;
|
||||
const chat = App.chats.find(c => c.id === chatId);
|
||||
if (!chat) return;
|
||||
|
||||
// Update local state
|
||||
if (!chat.settings) chat.settings = {};
|
||||
chat.settings.auto_compaction = enabled;
|
||||
|
||||
// Persist to server (JSONB merge)
|
||||
try {
|
||||
await API.updateChannel(chatId, { settings: { auto_compaction: enabled } });
|
||||
} catch (e) {
|
||||
console.warn('Failed to save auto-compaction setting:', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Chat Management ──────────────────────────
|
||||
|
||||
async function loadChats() {
|
||||
|
||||
Reference in New Issue
Block a user