mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-16 17:46:18 +08:00
refactor(server): config system (#11081)
This commit is contained in:
@@ -195,7 +195,7 @@ export function Template(props: PropsWithChildren) {
|
||||
</>
|
||||
);
|
||||
|
||||
if (typeof AFFiNE !== 'undefined' && AFFiNE.node.test) {
|
||||
if (env.testing) {
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ type EmailContent = {
|
||||
|
||||
function render(component: React.ReactElement) {
|
||||
return rawRender(component, {
|
||||
pretty: AFFiNE.node.test,
|
||||
pretty: env.testing,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ function make<T extends React.ComponentType<any>>(
|
||||
subject: string | ((props: Props<T>) => string)
|
||||
): EmailRenderer<Props<T>> {
|
||||
return async props => {
|
||||
if (!props && AFFiNE.node.test) {
|
||||
if (!props && env.testing) {
|
||||
// @ts-expect-error test only
|
||||
props = Component.PreviewProps;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user