File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
ui/src/components/PluginRender Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 2020import React , { FC , ReactNode } from 'react' ;
2121
2222import 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 }
You can’t perform that action at this time.
0 commit comments