Auth follow update

This commit is contained in:
Zhiyuan Zheng 2022-04-30 23:41:48 +02:00
parent d23f454148
commit 546847fd9a
3 changed files with 14 additions and 4 deletions

View File

@ -1,11 +1,11 @@
import { useNavigation } from '@react-navigation/native'
import { TabMeStackNavigationProp } from '@utils/navigation/navigators'
import addInstance from '@utils/slices/instances/add'
import { Instance } from '@utils/slices/instancesSlice'
import { checkInstanceFeature, Instance } from '@utils/slices/instancesSlice'
import * as AuthSession from 'expo-auth-session'
import React, { useEffect } from 'react'
import { useQueryClient } from 'react-query'
import { useDispatch } from 'react-redux'
import { useDispatch, useSelector } from 'react-redux'
export interface Props {
instanceDomain: string
@ -27,11 +27,16 @@ const InstanceAuth = React.memo(
const queryClient = useQueryClient()
const dispatch = useDispatch()
const deprecateAuthFollow = useSelector(
checkInstanceFeature('deprecate_auth_follow')
)
const [request, response, promptAsync] = AuthSession.useAuthRequest(
{
clientId: appData.clientId,
clientSecret: appData.clientSecret,
scopes: ['read', 'write', 'follow', 'push'],
scopes: deprecateAuthFollow
? ['read', 'write', 'push']
: ['read', 'write', 'follow', 'push'],
redirectUri
},
{

View File

@ -35,7 +35,7 @@ const TimelineFeedback = React.memo(
return (
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<View>
<View style={{ flexDirection: 'row' }}>
{status.reblogs_count > 0 ? (
<Text
accessibilityLabel={t(

View File

@ -3,5 +3,10 @@
"feature": "edit_post",
"version": 3.5,
"reference": "https://github.com/mastodon/mastodon/releases/tag/v3.5.0"
},
{
"feature": "deprecate_auth_follow",
"version": 3.5,
"reference": "https://github.com/mastodon/mastodon/releases/tag/v3.5.0"
}
]