Compare commits
No commits in common. "45e447850649bcf60c34c51c44056a2a08f57fe2" and "4b669a7b5d71df2c44bfa8b46968d0e3f3b653e9" have entirely different histories.
45e4478506
...
4b669a7b5d
4
app.json
4
app.json
|
|
@ -18,9 +18,7 @@
|
||||||
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
"monochromeImage": "./assets/images/android-icon-monochrome.png"
|
||||||
},
|
},
|
||||||
"predictiveBackGestureEnabled": false,
|
"predictiveBackGestureEnabled": false,
|
||||||
"package": "com.anonymous.acupedia",
|
"package": "com.anonymous.acupedia"
|
||||||
"usesCleartextTraffic": true,
|
|
||||||
"allowBackup": false
|
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"output": "static",
|
"output": "static",
|
||||||
|
|
|
||||||
|
|
@ -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