fix: Disable Notion import when env is not available (#8761)

This commit is contained in:
Tom Moor
2025-03-23 22:52:54 -04:00
committed by GitHub
parent 40278b2d9a
commit bdb34a202c
2 changed files with 7 additions and 2 deletions

View File

@@ -81,7 +81,12 @@ export const Notion = observer(() => {
}, [t, appName, oauthError]);
return (
<Button type="submit" onClick={() => redirectTo(authUrl)} neutral>
<Button
type="submit"
onClick={() => redirectTo(authUrl)}
disabled={!env.NOTION_CLIENT_ID}
neutral
>
{t("Import")}
</Button>
);

View File

@@ -5,8 +5,8 @@ import environment from "@server/utils/environment";
import { CannotUseWithout } from "@server/utils/validators";
class NotionPluginEnvironment extends Environment {
@IsOptional()
@Public
@IsOptional()
public NOTION_CLIENT_ID = this.toOptionalString(environment.NOTION_CLIENT_ID);
@IsOptional()