fix: copilot not working (#3425)

This commit is contained in:
Alex Yang
2023-07-27 17:28:21 -07:00
committed by GitHub
parent aa69a7cad2
commit f9929ebd61
11 changed files with 165 additions and 181 deletions
+15
View File
@@ -2,6 +2,7 @@ import type { PluginContext } from '@toeverything/plugin-infra/entry';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';
import { DebugContent } from './UI/debug-content';
import { DetailContent } from './UI/detail-content';
import { HeaderItem } from './UI/header-item';
@@ -29,5 +30,19 @@ export const entry = (context: PluginContext) => {
root.unmount();
};
});
context.register('setting', div => {
const root = createRoot(div);
root.render(
createElement(
context.utils.PluginProvider,
{},
createElement(DebugContent)
)
);
return () => {
root.unmount();
};
});
return () => {};
};