mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-10 20:45:43 +08:00
feat(feishu): hide archived sessions by default (/archived on to reveal)
This commit is contained in:
parent
961dd5503d
commit
10fd429852
3 changed files with 14 additions and 8 deletions
|
|
@ -7,7 +7,7 @@ const EMPTY_STATE = Object.freeze({
|
|||
seenMessageIds: [],
|
||||
watches: {},
|
||||
chatTargets: {},
|
||||
includeArchivedSessions: true,
|
||||
includeArchivedSessions: false,
|
||||
});
|
||||
|
||||
/** One conversation key may watch at most this many sessions. */
|
||||
|
|
@ -41,7 +41,7 @@ export class StateStore {
|
|||
chatTargets: parsed.chatTargets && typeof parsed.chatTargets === 'object' ? parsed.chatTargets : {},
|
||||
includeArchivedSessions: typeof parsed.includeArchivedSessions === 'boolean'
|
||||
? parsed.includeArchivedSessions
|
||||
: true,
|
||||
: false,
|
||||
};
|
||||
} catch (error) {
|
||||
if (error?.code !== 'ENOENT') throw error;
|
||||
|
|
@ -161,11 +161,11 @@ export class StateStore {
|
|||
// ── Session-list archived policy (per bot) ───────────────────────────────
|
||||
|
||||
includesArchivedSessions() {
|
||||
return this.#state.includeArchivedSessions !== false;
|
||||
return this.#state.includeArchivedSessions === true;
|
||||
}
|
||||
|
||||
async setIncludeArchivedSessions(include) {
|
||||
this.#state.includeArchivedSessions = include !== false;
|
||||
this.#state.includeArchivedSessions = include === true;
|
||||
await this.#persist();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue