fix: reset-to-auto in both rip branches, visible mutation failures, distinct invalid-token error
This commit is contained in:
@@ -10,6 +10,7 @@ function toErrorKind(err: unknown): ScanErrorKind {
|
||||
if (err instanceof ApiError) {
|
||||
if (err.code === 'not_found') return 'not_found'
|
||||
if (err.code === 'no_discogs_token') return 'no_discogs_token'
|
||||
if (err.code === 'discogs_auth') return 'discogs_auth'
|
||||
if (err.code === 'discogs_rate_limited' || err.status === 429) return 'rate_limited'
|
||||
}
|
||||
return 'server'
|
||||
@@ -179,11 +180,16 @@ export default function AddPage() {
|
||||
{state.phase === 'error' && (
|
||||
<div className="space-y-3 py-8 text-center">
|
||||
<p className="text-lg font-medium">
|
||||
{state.kind === 'not_found' ? 'Nothing found' : 'Search failed'}
|
||||
{state.kind === 'not_found'
|
||||
? 'Nothing found'
|
||||
: state.kind === 'discogs_auth'
|
||||
? 'Discogs rejected your token'
|
||||
: 'Search failed'}
|
||||
</p>
|
||||
<p className="text-sm text-neutral-400">
|
||||
{state.kind === 'not_found' && 'Try different spelling, or add the year.'}
|
||||
{state.kind === 'no_discogs_token' && 'Add your Discogs token in Settings first.'}
|
||||
{state.kind === 'discogs_auth' && 'Check your Discogs token in Settings.'}
|
||||
{state.kind === 'rate_limited' && 'Discogs is rate limiting us. Try again shortly.'}
|
||||
</p>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user