fix(notifications): a notice keeps what to say and says it in the reader's language when shown
This commit is contained in:
@@ -8,7 +8,7 @@ import { notifyActionError } from "../../lib/actionErrors";
|
||||
import { sinceOf } from "../../lib/activityUrlState";
|
||||
import { auditActionLabel, auditText } from "../../lib/auditText";
|
||||
import { formatDateTimeSec } from "../../lib/format";
|
||||
import { notify } from "../../lib/notifications";
|
||||
import { msg, notify } from "../../lib/notifications";
|
||||
import { qk } from "../../lib/queryKeys";
|
||||
import { useHistoryList } from "../../lib/useHistoryList";
|
||||
import type { Shared } from "./ActivityRuns";
|
||||
@@ -70,9 +70,9 @@ export default function ActivityAudit({
|
||||
onSuccess: (r) => {
|
||||
void qc.invalidateQueries({ queryKey: qk.adminAudit() });
|
||||
void qc.invalidateQueries({ queryKey: qk.adminAuditFacets() });
|
||||
notify({ level: "success", message: t("audit.cleared", { count: r.cleared }) });
|
||||
notify({ level: "success", message: msg("audit.cleared", { count: r.cleared }) });
|
||||
},
|
||||
onError: (e) => notifyActionError(e, t("audit.clearFailed")),
|
||||
onError: (e) => notifyActionError(e, msg("audit.clearFailed")),
|
||||
});
|
||||
const onClear = async () => {
|
||||
if (
|
||||
|
||||
@@ -15,7 +15,7 @@ import { nextPageOnClick } from "../../lib/nextPage";
|
||||
import { LEVEL_GROUPS, type LevelGroup } from "../../lib/log";
|
||||
import { sinceOf } from "../../lib/activityUrlState";
|
||||
import { logsParamsToState, logsParamUpdates, type LogsUrlState } from "../../lib/logsUrlState";
|
||||
import { notify } from "../../lib/notifications";
|
||||
import { msg, notify } from "../../lib/notifications";
|
||||
import { qk } from "../../lib/queryKeys";
|
||||
import { useUrlMirror } from "../../lib/useUrlMirror";
|
||||
import { HistoryFrame } from "./HistoryList";
|
||||
@@ -187,8 +187,8 @@ export default function AdminLogs({
|
||||
const ok = await copyText(text);
|
||||
notify(
|
||||
ok
|
||||
? { level: "success", message: t("adminLogs.copied", { count: rows.length }) }
|
||||
: { level: "error", message: t("adminLogs.copyFailed") },
|
||||
? { level: "success", message: msg("adminLogs.copied", { count: rows.length }) }
|
||||
: { level: "error", message: msg("adminLogs.copyFailed") },
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user