mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +00:00
fix(settings): report the outcome of quiet settings actions
Adding or removing a passkey or a security key only redrew the list. Disconnecting an integration and revoking a share link ran from a dialog that had already closed, so a refused request left everything as it was without a word. The injection-site exclusions, the local OCR switch and the preventive-care reminder switches saved, or did not, in silence. Each now reports through the outcome toast and, where the card has no inline error line, the shared error toast with its error id.
This commit is contained in:
1 parent
b6e3b47bec
commit
2bb3783b14
16 files changed
+302
-30
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { toastWrittenOutcome } from "@/components/outcome/outcome-toast";
|
||||
import {
|
||||
AlertTriangle,
|
||||
Check,
|
||||
@@ -142,6 +143,7 @@ export function PasskeyListSection({
|
||||
setReauthSecret("");
|
||||
setReauthMethod("password");
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.passkeys() });
|
||||
toastWrittenOutcome("success", t("settings.passkeyAddedToast"));
|
||||
},
|
||||
onError: (err) => {
|
||||
if (err instanceof ApiError) {
|
||||
@@ -178,6 +180,7 @@ export function PasskeyListSection({
|
||||
onSuccess: () => {
|
||||
setMsg(null);
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.passkeys() });
|
||||
toastWrittenOutcome("success", t("settings.passkeyRemovedToast"));
|
||||
},
|
||||
// A refusal the dialog could not take up keeps its own sentence. The
|
||||
// server's prose says "second-factor", which is wrong for the passkey-only
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||
import { toastWrittenOutcome } from "@/components/outcome/outcome-toast";
|
||||
import {
|
||||
AlertTriangle,
|
||||
Check,
|
||||
@@ -133,6 +134,7 @@ export function SecurityKeysCard({
|
||||
setReauthOpen(false);
|
||||
setReauthError(null);
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.mfaStatus() });
|
||||
toastWrittenOutcome("success", t("settings.security.keys.addedToast"));
|
||||
},
|
||||
onError: (err, proof) => {
|
||||
if (isReproofRequired(err) && nothingToReprove(err)) {
|
||||
@@ -192,6 +194,7 @@ export function SecurityKeysCard({
|
||||
onSuccess: () => {
|
||||
setError(null);
|
||||
queryClient.invalidateQueries({ queryKey: queryKeys.mfaStatus() });
|
||||
toastWrittenOutcome("success", t("settings.security.keys.removedToast"));
|
||||
},
|
||||
onError: (err) => {
|
||||
if (err instanceof ReproofCancelledError) return;
|
||||
|
||||
Reference in new issue
Block a user