mirror of
https://github.com/docmost/docmost.git
synced 2026-08-24 08:12:15 +10:00
refactor(client): type diffCountsAtom initializer so setters infer as writable
This commit is contained in:
@@ -6,7 +6,9 @@ export const activeHistoryPrevIdAtom = atom<string>("");
|
|||||||
export const highlightChangesAtom = atom<boolean>(true);
|
export const highlightChangesAtom = atom<boolean>(true);
|
||||||
|
|
||||||
export type DiffCounts = { added: number; deleted: number; total: number };
|
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 type ComparePair = { newerId: string; olderId: string };
|
||||||
export const compareModeAtom = atom<boolean>(false);
|
export const compareModeAtom = atom<boolean>(false);
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ export function HistoryEditor({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const total = addedCount + deletedCount;
|
const total = addedCount + deletedCount;
|
||||||
// @ts-ignore
|
|
||||||
setDiffCounts({ added: addedCount, deleted: deletedCount, total });
|
setDiffCounts({ added: addedCount, deleted: deletedCount, total });
|
||||||
|
|
||||||
editor.setOptions({
|
editor.setOptions({
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ export function useHistoryReset(pageId: string) {
|
|||||||
|
|
||||||
setActiveHistoryId("");
|
setActiveHistoryId("");
|
||||||
setActiveHistoryPrevId("");
|
setActiveHistoryPrevId("");
|
||||||
// @ts-ignore
|
|
||||||
setDiffCounts(null);
|
setDiffCounts(null);
|
||||||
resetCompare();
|
resetCompare();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user