Merge branch 'dev'

This commit is contained in:
Mo Tarbin
2026-01-21 00:16:40 -05:00
2 changed files with 15 additions and 10 deletions

View File

@@ -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)

View File

@@ -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 = {}) => {