refactor to integrate messageStore and unreadCounts

This commit is contained in:
Dan Ditomaso
2025-04-04 22:22:35 -04:00
committed by GitHub
parent c8c89fdc95
commit 4755c0eeb9
8 changed files with 118 additions and 115 deletions
@@ -3,8 +3,8 @@ import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts";
import { beforeEach, describe, expect, it, Mock, vi } from "vitest";
import { useDevice } from "@core/stores/deviceStore.ts";
vi.mock("@core/stores/appStore.ts", () => ({
useAppStore: vi.fn(() => ({ activeChat: "chat-123" })),
vi.mock("@core/stores/messageStore.ts", () => ({
useMessageStore: vi.fn(() => ({ activeChat: "chat-123" })),
}));
vi.mock("@core/stores/deviceStore.ts", () => ({
@@ -1,10 +1,10 @@
import { useCallback } from "react";
import { useAppStore } from "@core/stores/appStore.ts";
import { useDevice } from "@core/stores/deviceStore.ts";
import { useMessageStore } from "@core/stores/messageStore.ts";
export function useRefreshKeysDialog() {
const { removeNode, setDialogOpen, clearNodeError, getNodeError } = useDevice();
const { activeChat } = useAppStore();
const { activeChat } = useMessageStore();
const handleNodeRemove = useCallback(() => {
const nodeWithError = getNodeError(activeChat);