fix: Update import paths for apiClient to use consistent casing
This commit is contained in:
@@ -100,15 +100,20 @@ export const isOfficialDonetickInstance = async () => {
|
||||
export const isOfficialDonetickInstanceSync = () => {
|
||||
try {
|
||||
// Dynamic import to avoid circular dependencies
|
||||
return import('./apiClient').then(({ apiClient }) => {
|
||||
const currentApiUrl = apiClient.baseURL
|
||||
// Check if the API URL contains donetick.com
|
||||
return currentApiUrl.toLowerCase().includes('donetick.com')
|
||||
}).catch(error => {
|
||||
console.warn('FeatureToggle: Error checking server instance (sync):', error)
|
||||
// Default to false for safety (self-hosted assumption)
|
||||
return false
|
||||
})
|
||||
return import('./ApiClient')
|
||||
.then(({ apiClient }) => {
|
||||
const currentApiUrl = apiClient.baseURL
|
||||
// Check if the API URL contains donetick.com
|
||||
return currentApiUrl.toLowerCase().includes('donetick.com')
|
||||
})
|
||||
.catch(error => {
|
||||
console.warn(
|
||||
'FeatureToggle: Error checking server instance (sync):',
|
||||
error,
|
||||
)
|
||||
// Default to false for safety (self-hosted assumption)
|
||||
return false
|
||||
})
|
||||
} catch (error) {
|
||||
console.warn('FeatureToggle: Error checking server instance (sync):', error)
|
||||
// Default to false for safety (self-hosted assumption)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { apiClient } from './apiClient'
|
||||
`import { apiClient } from './ApiClient'
|
||||
|
||||
// Migration helpers to maintain compatibility with existing code
|
||||
const Fetch = async (endpoint, options = {}) => {
|
||||
|
||||
Reference in New Issue
Block a user