mirror of
https://github.com/usememos/memos.git
synced 2024-11-11 01:12:40 +08:00
feat: add notice when sharing private links (#2809)
Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
parent
73337331cb
commit
1bad0543d0
4 changed files with 9 additions and 2 deletions
|
@ -7,7 +7,7 @@ import { downloadFileFromUrl } from "@/helpers/utils";
|
|||
import useLoading from "@/hooks/useLoading";
|
||||
import toImage from "@/labs/html2image";
|
||||
import { useUserStore, extractUsernameFromName } from "@/store/v1";
|
||||
import { Memo } from "@/types/proto/api/v2/memo_service";
|
||||
import { Memo, Visibility } from "@/types/proto/api/v2/memo_service";
|
||||
import { useTranslate } from "@/utils/i18n";
|
||||
import { generateDialog } from "./Dialog";
|
||||
import Icon from "./Icon";
|
||||
|
@ -68,7 +68,11 @@ const ShareMemoDialog: React.FC<Props> = (props: Props) => {
|
|||
|
||||
const handleCopyLinkBtnClick = () => {
|
||||
copy(`${window.location.origin}/m/${memo.name}`);
|
||||
if (memo.visibility !== Visibility.PUBLIC) {
|
||||
toast.success(t("message.succeed-copy-link-not-public"));
|
||||
} else {
|
||||
toast.success(t("message.succeed-copy-link"));
|
||||
}
|
||||
};
|
||||
|
||||
if (loadingState.isLoading) {
|
||||
|
|
|
@ -352,6 +352,7 @@
|
|||
"private-only": "This memo is set to private.",
|
||||
"copied": "Copied",
|
||||
"succeed-copy-content": "Content copied successfully.",
|
||||
"succeed-copy-link-not-public": "Content copied successfully. This memo is not accessible without logging in.",
|
||||
"succeed-copy-code": "Code copied successfully.",
|
||||
"succeed-copy-link": "Link copied successfully.",
|
||||
"change-resource-filename": "Change resource filename",
|
||||
|
|
|
@ -175,6 +175,7 @@
|
|||
"succeed-copy-code": "复制代码到剪贴板成功。",
|
||||
"succeed-copy-content": "复制内容到剪贴板成功。",
|
||||
"succeed-copy-link": "复制链接到剪贴板成功。",
|
||||
"succeed-copy-link-not-public": "复制链接到剪贴板成功,请注意本条备忘录在未登录情况下不可访问。",
|
||||
"succeed-copy-resource-link": "复制资源链接到剪贴板成功。",
|
||||
"succeed-update-additional-script": "更新附加脚本成功。",
|
||||
"succeed-update-additional-style": "更新附加样式成功。",
|
||||
|
|
|
@ -177,6 +177,7 @@
|
|||
"succeed-copy-code": "複製程式碼到剪貼簿成功。",
|
||||
"succeed-copy-content": "複製內容到剪貼簿成功。",
|
||||
"succeed-copy-link": "複製連結到剪貼簿成功。",
|
||||
"succeed-copy-link-not-public": "複製連結到剪貼簿成功,請注意本條備忘錄在未登入情況下無法瀏覽。",
|
||||
"succeed-copy-resource-link": "複製資源連結到剪貼簿成功。",
|
||||
"succeed-update-additional-script": "更新附加腳本成功。",
|
||||
"succeed-update-additional-style": "更新附加樣式成功。",
|
||||
|
|
Loading…
Reference in a new issue