refactor(client): type diffCountsAtom initializer so setters infer as writable

This commit is contained in:
Philipinho
2026-08-11 21:18:46 +01:00
parent e7b4f2110f
commit 14d0ad5b01
3 changed files with 3 additions and 3 deletions
@@ -6,7 +6,9 @@ export const activeHistoryPrevIdAtom = atom<string>("");
export const highlightChangesAtom = atom<boolean>(true);
export type DiffCounts = { added: number; deleted: number; total: number };
export const diffCountsAtom = atom<DiffCounts | null>(null);
export const diffCountsAtom = atom<DiffCounts | null>(
null as DiffCounts | null,
);
export type ComparePair = { newerId: string; olderId: string };
export const compareModeAtom = atom<boolean>(false);
@@ -170,7 +170,6 @@ export function HistoryEditor({
}
const total = addedCount + deletedCount;
// @ts-ignore
setDiffCounts({ added: addedCount, deleted: deletedCount, total });
editor.setOptions({
@@ -31,7 +31,6 @@ export function useHistoryReset(pageId: string) {
setActiveHistoryId("");
setActiveHistoryPrevId("");
// @ts-ignore
setDiffCounts(null);
resetCompare();