Skip to content

Commit 9897d92

Browse files
committed
fix: adjustment of the position of plug-in inserting the editor toolbar
1 parent 1ef6797 commit 9897d92

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ui/src/components/PluginRender/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import React, { FC, ReactNode } from 'react';
2121

2222
import PluginKit, { Plugin, PluginType } from '@/utils/pluginKit';
23-
import { writeSettingStore } from '@/stores';
2423
/**
2524
* Note:Please set at least either of the `slug_name` and `type` attributes, otherwise no plugins will be rendered.
2625
*
@@ -48,9 +47,6 @@ const Index: FC<Props> = ({
4847
}) => {
4948
const pluginSlice: Plugin[] = [];
5049
const plugins = PluginKit.getPlugins().filter((plugin) => plugin.activated);
51-
const { authorized_attachment_extensions = [] } = writeSettingStore(
52-
(state) => state.write,
53-
);
5450

5551
plugins.forEach((plugin) => {
5652
if (type && slug_name) {
@@ -80,10 +76,9 @@ const Index: FC<Props> = ({
8076
}
8177

8278
if (type === 'editor') {
83-
const showAttachFile = authorized_attachment_extensions?.length > 0;
84-
const pendIndex = showAttachFile ? 16 : 15;
79+
// index 16 is the position of the toolbar in the editor for plugins
8580
const nodes = React.Children.map(children, (child, index) => {
86-
if (index === pendIndex) {
81+
if (index === 16) {
8782
return (
8883
<>
8984
{child}

0 commit comments

Comments
 (0)