Fix Codex auth import and reset credit details
CodexBar Mobile Build / build-android (push) Successful in 17m26s
CodexBar Mobile Build / release (push) Successful in 12s

# Conflicts:
#	app/(tabs)/codex.tsx
#	app/(tabs)/index.tsx
#	app/(tabs)/settings.tsx
#	hooks/useCodexUsage.ts
#	lib/api/codexApi.ts
#	package-lock.json
#	package.json
This commit is contained in:
Space-Banane
2026-07-04 18:59:56 +02:00
parent 5a00822690
commit dc7e497388
13 changed files with 837 additions and 498 deletions
+9 -2
View File
@@ -8,6 +8,13 @@ import { saveCodexAuth, loadCodexAuth } from "@/lib/storage";
import type { CodexAuth } from "@/types/codex";
import { COLORS } from "@/lib/constants";
function humanizeImportError(code: string): string {
if (code === "DOCUMENT_NOT_READABLE") {
return "The selected file could not be read. Try copying auth.json into Files or Downloads and import it again.";
}
return code;
}
export default function OnboardingCodexScreen() {
const [auth, setAuth] = useState<CodexAuth | null>(null);
const [loading, setLoading] = useState(false);
@@ -28,7 +35,7 @@ export default function OnboardingCodexScreen() {
setAuth(parsed);
} catch (e: unknown) {
const msg = e instanceof Error ? e.message : "UNKNOWN_ERROR";
if (msg !== "PICKER_CANCELLED") setError(msg);
if (msg !== "PICKER_CANCELLED") setError(humanizeImportError(msg));
} finally {
setLoading(false);
}
@@ -86,7 +93,7 @@ export default function OnboardingCodexScreen() {
<MaterialIcons name="check-circle" size={22} color={COLORS.codex} />
</View>
<View className="flex-1">
<Text className="text-white font-semibold">Connected</Text>
<Text className="text-white font-semibold">Imported</Text>
{auth.accountId && (
<Text className="text-neutral-500 text-sm font-mono">
{auth.accountId.slice(0, 12)}