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 = () => {
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)

View File

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