This commit is contained in:
alorig
2025-11-22 20:51:07 +05:00
parent e2c0d3d0fc
commit d4990fb088
4 changed files with 98 additions and 6 deletions

View File

@@ -212,10 +212,19 @@ export default function SiteSettings() {
// Check basic configuration (API key + toggle)
useEffect(() => {
const checkStatus = async () => {
if (wordPressIntegration && wordPressIntegration.is_active && site?.wp_api_key) {
setIntegrationStatus('configured');
// Test authentication
testAuthentication();
// If integration exists and is active, mark as configured
if (wordPressIntegration && wordPressIntegration.is_active) {
// Check if API key exists (either in site or in integration credentials)
const hasApiKey = site?.wp_api_key ||
(wordPressIntegration.credentials_json?.api_key);
if (hasApiKey) {
setIntegrationStatus('configured');
// Test authentication
testAuthentication();
} else {
setIntegrationStatus('not_configured');
}
} else {
setIntegrationStatus('not_configured');
}