1
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user