fix: resolve TS errors from missing createAddressBook in demo client and client ref in thread view
This commit is contained in:
@@ -88,6 +88,7 @@ export function ThreadConversationView({
|
|||||||
const trustedSendersAddressBook = useSettingsStore((state) => state.trustedSendersAddressBook);
|
const trustedSendersAddressBook = useSettingsStore((state) => state.trustedSendersAddressBook);
|
||||||
const isTrustedAddressBookSender = useContactStore((state) => state.isTrustedAddressBookSender);
|
const isTrustedAddressBookSender = useContactStore((state) => state.isTrustedAddressBookSender);
|
||||||
const addToTrustedSendersBook = useContactStore((state) => state.addToTrustedSendersBook);
|
const addToTrustedSendersBook = useContactStore((state) => state.addToTrustedSendersBook);
|
||||||
|
const { client } = useAuthStore();
|
||||||
|
|
||||||
// Track which emails are expanded (most recent by default)
|
// Track which emails are expanded (most recent by default)
|
||||||
const [expandedIds, setExpandedIds] = useState<Set<string>>(new Set());
|
const [expandedIds, setExpandedIds] = useState<Set<string>>(new Set());
|
||||||
|
|||||||
@@ -481,6 +481,12 @@ export class DemoJMAPClient implements IJMAPClient {
|
|||||||
async getAddressBooks(): Promise<AddressBook[]> { return [...this.data.addressBooks]; }
|
async getAddressBooks(): Promise<AddressBook[]> { return [...this.data.addressBooks]; }
|
||||||
async getAllAddressBooks(): Promise<AddressBook[]> { return [...this.data.addressBooks]; }
|
async getAllAddressBooks(): Promise<AddressBook[]> { return [...this.data.addressBooks]; }
|
||||||
|
|
||||||
|
async createAddressBook(name: string): Promise<AddressBook> {
|
||||||
|
const book: AddressBook = { id: `demo-book-${Date.now()}`, name };
|
||||||
|
this.data.addressBooks.push(book);
|
||||||
|
return book;
|
||||||
|
}
|
||||||
|
|
||||||
async updateAddressBook(addressBookId: string, updates: Partial<AddressBook>): Promise<void> {
|
async updateAddressBook(addressBookId: string, updates: Partial<AddressBook>): Promise<void> {
|
||||||
const book = this.data.addressBooks.find(b => b.id === addressBookId);
|
const book = this.data.addressBooks.find(b => b.id === addressBookId);
|
||||||
if (book) Object.assign(book, updates);
|
if (book) Object.assign(book, updates);
|
||||||
|
|||||||
Reference in New Issue
Block a user