@dubsdotapp/expo 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/provider.tsx +9 -1
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -378,7 +378,7 @@ export class DubsClient {
|
|
|
378
378
|
|
|
379
379
|
/** Fetch the app's UI customization config (accent color, icon, tagline) */
|
|
380
380
|
async getAppConfig(): Promise<UiConfig> {
|
|
381
|
-
const res = await this.request<{ uiConfig: UiConfig }>('GET', '/apps/config');
|
|
382
|
-
return res.uiConfig || {};
|
|
381
|
+
const res = await this.request<{ data: { uiConfig: UiConfig } }>('GET', '/apps/config');
|
|
382
|
+
return res.data?.uiConfig || {};
|
|
383
383
|
}
|
|
384
384
|
}
|
package/src/provider.tsx
CHANGED
|
@@ -83,7 +83,15 @@ export function DubsProvider({
|
|
|
83
83
|
// Fetch developer UI config on mount (silent fail = default theme)
|
|
84
84
|
const [uiConfig, setUiConfig] = useState<UiConfig | null>(null);
|
|
85
85
|
useEffect(() => {
|
|
86
|
-
client.getAppConfig()
|
|
86
|
+
client.getAppConfig()
|
|
87
|
+
.then((config) => {
|
|
88
|
+
console.log('[DubsProvider] UI config loaded:', JSON.stringify(config));
|
|
89
|
+
setUiConfig(config);
|
|
90
|
+
})
|
|
91
|
+
.catch((err) => {
|
|
92
|
+
console.log('[DubsProvider] UI config fetch failed, using defaults:', err?.message);
|
|
93
|
+
setUiConfig({});
|
|
94
|
+
});
|
|
87
95
|
}, [client]);
|
|
88
96
|
|
|
89
97
|
// Wait for config before rendering so accent color is applied on first paint
|