This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/test by this push:
     new 9897d92e fix: adjustment of the position of plug-in inserting the 
editor toolbar
9897d92e is described below

commit 9897d92e53243fd37a5f2bd7c773bc6fd555d7f7
Author: shuai <lishuail...@sifou.com>
AuthorDate: Wed Jul 2 17:01:33 2025 +0800

    fix: adjustment of the position of plug-in inserting the editor toolbar
---
 ui/src/components/PluginRender/index.tsx | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

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}

Reply via email to