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