fix(notifications): a notice keeps what to say and says it in the reader's language when shown
This commit is contained in:
@@ -2,7 +2,7 @@ import type { QueryClient } from "@tanstack/react-query";
|
||||
import { qk } from "./queryKeys";
|
||||
import { api, type NewShareLink } from "./api";
|
||||
import { copyText } from "./clipboard";
|
||||
import { notify } from "./notifications";
|
||||
import { msg, notify } from "./notifications";
|
||||
import { notifyActionError } from "./actionErrors";
|
||||
|
||||
// The download queue, the per-card download index, the library (its listings and folder counts) and
|
||||
@@ -65,7 +65,7 @@ export async function quickShareLink(
|
||||
}
|
||||
if (!path) throw new Error("the new link came back without its address");
|
||||
} catch (e) {
|
||||
notifyActionError(e, t("downloads.share.linkFailed"));
|
||||
notifyActionError(e, msg("downloads.share.linkFailed"));
|
||||
return null;
|
||||
}
|
||||
const url = window.location.origin + path;
|
||||
@@ -75,8 +75,8 @@ export async function quickShareLink(
|
||||
};
|
||||
notify(
|
||||
(await copyText(url))
|
||||
? { level: "success", message: t("downloads.share.linkCopied"), action }
|
||||
: { level: "warning", message: t("downloads.share.copyFailed"), action },
|
||||
? { level: "success", message: msg("downloads.share.linkCopied"), action }
|
||||
: { level: "warning", message: msg("downloads.share.copyFailed"), action },
|
||||
);
|
||||
return url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user