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
+7 -1
View File
@@ -35,6 +35,12 @@ import { ScreenErrorBoundary } from "@/components/ScreenErrorBoundary";
import type { CodexAuth } from "@/types/codex";
import Constants from "expo-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;
}
function SettingRow({
icon,
label,
@@ -160,7 +166,7 @@ function SettingsTabContent() {
} catch (e: unknown) {
const msg = e instanceof Error ? e.message : "UNKNOWN_ERROR";
if (msg !== "PICKER_CANCELLED") {
Alert.alert("Import failed", msg);
Alert.alert("Import failed", humanizeImportError(msg));
}
}
};