@bbki.ng/site 2.0.22 → 2.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ import { PluginsMenuItem } from "@/components/plugin/PluginsMenuItem";
|
|
|
14
14
|
import { PluginManager } from "@/plugin/PluginManager";
|
|
15
15
|
import { PluginEvent } from "@/plugin/PluginEvent";
|
|
16
16
|
import {PostMenuItem} from "@/components/app_ctx_menu/PostMenuItem";
|
|
17
|
+
import {useAuthed} from "@/hooks/use_authed";
|
|
17
18
|
|
|
18
19
|
export const AppCtxMenu = (props: { children: ReactElement }) => {
|
|
19
20
|
const [showPluginEntry, setShowPluginEntry] = React.useState(false);
|
|
@@ -30,13 +31,15 @@ export const AppCtxMenu = (props: { children: ReactElement }) => {
|
|
|
30
31
|
};
|
|
31
32
|
}, []);
|
|
32
33
|
|
|
34
|
+
const isKing = useAuthed();
|
|
35
|
+
|
|
33
36
|
return (
|
|
34
37
|
<ContextMenu>
|
|
35
38
|
<ContextMenuTrigger>{props.children}</ContextMenuTrigger>
|
|
36
39
|
<ContextMenuContent className="w-256">
|
|
37
40
|
<LoginMenuItem />
|
|
38
41
|
<ViewSourceMenuItem />
|
|
39
|
-
<PostMenuItem />
|
|
42
|
+
{isKing && <PostMenuItem />}
|
|
40
43
|
{/*{showPluginEntry && <PluginsMenuItem />}*/}
|
|
41
44
|
</ContextMenuContent>
|
|
42
45
|
</ContextMenu>
|
|
@@ -5,6 +5,7 @@ import {GlobalLoadingContext} from "@/context/global_loading_state_provider";
|
|
|
5
5
|
import {usePost} from "@/hooks/use_post";
|
|
6
6
|
import {API} from "@/constants/routes";
|
|
7
7
|
import {useAuthed} from "@/hooks/use_authed";
|
|
8
|
+
import {toast} from "sonner";
|
|
8
9
|
|
|
9
10
|
export const useClipboardToPost = () => {
|
|
10
11
|
const clipboardContent = useClipboardContent();
|
|
@@ -31,7 +32,12 @@ export const useClipboardToPost = () => {
|
|
|
31
32
|
|
|
32
33
|
post(title, restContent)
|
|
33
34
|
.then((r) => {
|
|
34
|
-
mutate(API.POSTS).then()
|
|
35
|
+
mutate(API.POSTS).then(() => {
|
|
36
|
+
toast("", {
|
|
37
|
+
description: `已更新`,
|
|
38
|
+
position: "bottom-right",
|
|
39
|
+
});
|
|
40
|
+
});
|
|
35
41
|
})
|
|
36
42
|
.finally(() => {
|
|
37
43
|
setIsLoading(false);
|