1
0
mirror of https://github.com/tooot-app/app synced 2024-12-22 07:34:06 +01:00

More permissive logging in

This commit is contained in:
xmflsct 2023-05-16 21:51:03 +02:00
parent 8aeeb1d806
commit a8243adf51
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
2 changed files with 8 additions and 5 deletions

View File

@ -52,7 +52,7 @@ const ComponentInstance: React.FC<Props> = ({
!!domain.length &&
!!errorCode &&
!!(Linking.parse(`https://${domain}/`).hostname === domain) &&
errorCode === 401
(errorCode === 401 || errorCode === 500)
const instanceQuery = useInstanceQuery({
domain,
@ -80,7 +80,7 @@ const ComponentInstance: React.FC<Props> = ({
clientSecret,
scopes: variables.scopes,
redirectUri,
usePKCE: !['pawoo.net', 'mao.mastodonhub.com'].includes(domain)
usePKCE: !['pawoo.net'].includes(domain)
})
await request.makeAuthUrlAsync(discovery)
@ -131,7 +131,8 @@ const ComponentInstance: React.FC<Props> = ({
((instanceQuery.data as Mastodon.Instance_V1)?.uri
? Linking.parse((instanceQuery.data as Mastodon.Instance_V1).uri).hostname
: undefined) ||
(instanceQuery.data as Mastodon.Instance_V1)?.uri,
(instanceQuery.data as Mastodon.Instance_V1)?.uri ||
domain,
'auth.account.avatar_static': avatar_static,
version: instanceQuery.data?.version || '0',
preferences: undefined,

View File

@ -34,5 +34,7 @@ const features: { feature: Features; version: number }[] = [
]
export const featureCheck = (feature: Features, v?: string): boolean =>
(features.find(f => f.feature === feature)?.version || 999) <=
parseFloat(v || getAccountStorage.string('version'))
v
? (features.find(f => f.feature === feature)?.version || 999) <=
parseFloat(v || getAccountStorage.string('version'))
: false