feat: manage shared/group account settings from Accounts page

This commit is contained in:
Linus Rath
2026-06-14 17:05:29 +02:00
parent 848ed9774d
commit 4c6c1aab60
16 changed files with 577 additions and 103 deletions
+6 -6
View File
@@ -13,7 +13,7 @@ interface VacationStore {
error: string | null;
isSupported: boolean;
fetchVacationResponse: (client: IJMAPClient) => Promise<void>;
fetchVacationResponse: (client: IJMAPClient, accountId?: string) => Promise<void>;
updateVacationResponse: (client: IJMAPClient, updates: {
isEnabled?: boolean;
fromDate?: string | null;
@@ -21,7 +21,7 @@ interface VacationStore {
subject?: string;
textBody?: string;
htmlBody?: string | null;
}) => Promise<void>;
}, accountId?: string) => Promise<void>;
setSupported: (supported: boolean) => void;
clearState: () => void;
}
@@ -38,10 +38,10 @@ export const useVacationStore = create<VacationStore>()((set) => ({
error: null,
isSupported: false,
fetchVacationResponse: async (client) => {
fetchVacationResponse: async (client, accountId) => {
set({ isLoading: true, error: null });
try {
const vacation = await client.getVacationResponse();
const vacation = await client.getVacationResponse(accountId);
set({
isEnabled: vacation.isEnabled,
fromDate: vacation.fromDate,
@@ -59,10 +59,10 @@ export const useVacationStore = create<VacationStore>()((set) => ({
}
},
updateVacationResponse: async (client, updates) => {
updateVacationResponse: async (client, updates, accountId) => {
set({ isSaving: true, error: null });
try {
await client.setVacationResponse(updates);
await client.setVacationResponse(updates, accountId);
set((state) => ({
...state,
...updates,