Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: adjustment of the position of plug-in inserting the editor toolbar

shuai9897d92e5324
diff --git a/ui/src/components/PluginRender/index.tsx b/ui/src/components/PluginRender/index.tsx
index 002d5a58..057f4952 100644
--- a/ui/src/components/PluginRender/index.tsx
+++ b/ui/src/components/PluginRender/index.tsx
@@ -20,7 +20,6 @@
import React, { FC, ReactNode } from 'react';
import PluginKit, { Plugin, PluginType } from '@/utils/pluginKit';
-import { writeSettingStore } from '@/stores';
/**
* Note:Please set at least either of the `slug_name` and `type` attributes, otherwise no plugins will be rendered.
*
@@ -48,9 +47,6 @@ const Index: FC<Props> = ({
}) => {
const pluginSlice: Plugin[] = [];
const plugins = PluginKit.getPlugins().filter((plugin) => plugin.activated);
- const { authorized_attachment_extensions = [] } = writeSettingStore(
- (state) => state.write,
- );
plugins.forEach((plugin) => {
if (type && slug_name) {
@@ -80,10 +76,9 @@ const Index: FC<Props> = ({
}
if (type === 'editor') {
- const showAttachFile = authorized_attachment_extensions?.length > 0;
- const pendIndex = showAttachFile ? 16 : 15;
+ // index 16 is the position of the toolbar in the editor for plugins
const nodes = React.Children.map(children, (child, index) => {
- if (index === pendIndex) {
+ if (index === 16) {
return (
<>
{child}