Compare commits
No commits in common. "354c3f48ae2da9baef246991a765a4fa0568a475" and "b9e7c6310aef04752ce01a41c7b72b95c1bb24fb" have entirely different histories.
354c3f48ae
...
b9e7c6310a
14
.env
14
.env
|
|
@ -10,16 +10,6 @@
|
||||||
# ---- Local Standalone Backend (FastAPI on Port 8000) ----
|
# ---- Local Standalone Backend (FastAPI on Port 8000) ----
|
||||||
# For Local Web: http://localhost:8000/api
|
# For Local Web: http://localhost:8000/api
|
||||||
# For Physical Mobile Devices: http://YOUR_LOCAL_IP:8000/api
|
# For Physical Mobile Devices: http://YOUR_LOCAL_IP:8000/api
|
||||||
# EXPO_PUBLIC_API_URL=http://localhost:8000/api
|
|
||||||
# EXPO_PUBLIC_BACKEND_PORT=8000
|
|
||||||
# EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/
|
|
||||||
#################################################################################
|
|
||||||
# old working .env file
|
|
||||||
|
|
||||||
# Production Dev
|
|
||||||
# EXPO_PUBLIC_API_URL=https://api.acupedia.in/api
|
|
||||||
# EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store
|
|
||||||
|
|
||||||
# Local Dev
|
|
||||||
EXPO_PUBLIC_API_URL=http://localhost:8000/api
|
EXPO_PUBLIC_API_URL=http://localhost:8000/api
|
||||||
EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000
|
EXPO_PUBLIC_BACKEND_PORT=8000
|
||||||
|
EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/
|
||||||
|
|
|
||||||
7
app.json
7
app.json
|
|
@ -17,10 +17,7 @@
|
||||||
"backgroundImage": "./assets/images/android-icon-background.png",
|
"backgroundImage": "./assets/images/android-icon-background.png",
|
||||||
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
||||||
},
|
},
|
||||||
"predictiveBackGestureEnabled": false,
|
"predictiveBackGestureEnabled": false
|
||||||
"package": "com.anonymous.acupedia",
|
|
||||||
"usesCleartextTraffic": true,
|
|
||||||
"allowBackup": false
|
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"output": "static",
|
"output": "static",
|
||||||
|
|
@ -42,4 +39,4 @@
|
||||||
"reactCompiler": true
|
"reactCompiler": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,5 @@
|
||||||
export function asString(value: unknown): string {
|
export function asString(value: unknown): string {
|
||||||
if (typeof value === "string") return value;
|
return typeof value === "string" ? value : "";
|
||||||
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
||||||
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
||||||
const record = value as Record<string, unknown>;
|
|
||||||
for (const key of ["label", "point_name", "name", "title", "code"]) {
|
|
||||||
if (typeof record[key] === "string" && (record[key] as string).trim().length > 0) {
|
|
||||||
return (record[key] as string).trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function asNumber(value: unknown): number | null {
|
export function asNumber(value: unknown): number | null {
|
||||||
|
|
@ -17,10 +7,9 @@ export function asNumber(value: unknown): number | null {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function asStringArray(value: unknown): string[] {
|
export function asStringArray(value: unknown): string[] {
|
||||||
if (!Array.isArray(value)) return [];
|
return Array.isArray(value)
|
||||||
return value
|
? value.filter((item): item is string => typeof item === "string" && item.trim().length > 0)
|
||||||
.map((item) => asString(item).trim())
|
: [];
|
||||||
.filter((item) => item.length > 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function asRecord(value: unknown): Record<string, unknown> {
|
export function asRecord(value: unknown): Record<string, unknown> {
|
||||||
|
|
|
||||||
|
|
@ -269,9 +269,6 @@ export const useAuthStore = create<AuthStore>()(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setApiAccessToken(state?.accessToken ?? null);
|
setApiAccessToken(state?.accessToken ?? null);
|
||||||
if (state?.accessToken && state?.isAuthenticated) {
|
|
||||||
void useAuthStore.getState().refreshSession();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue