fix(plugins/settings): navigate to Plugins screen correctly in plugin error alert
This commit is contained in:
parent
2293e288d1
commit
96ea57c559
1 changed files with 17 additions and 3 deletions
|
|
@ -39,6 +39,19 @@ export default function PluginsFailedToStartAlert({
|
|||
variant="primary"
|
||||
text="View plugins"
|
||||
onPress={() => {
|
||||
/**
|
||||
* Discord's navigator hierarchy:
|
||||
*
|
||||
* main (Stack)
|
||||
* - tabs (BottomTab)
|
||||
* - guilds
|
||||
* - notifications
|
||||
* - you
|
||||
* - settings (Stack)
|
||||
* - ...
|
||||
* - (our screens)
|
||||
*/
|
||||
|
||||
const params = {
|
||||
filter: ['Has Errors'],
|
||||
}
|
||||
|
|
@ -48,11 +61,12 @@ export default function PluginsFailedToStartAlert({
|
|||
RouteNames.RevengePlugins
|
||||
)
|
||||
navigation.setParams(params)
|
||||
// React Navigation will bubble our requests to the main navigator if we're already in settings
|
||||
else
|
||||
navigation.navigate(
|
||||
RouteNames.RevengePlugins,
|
||||
navigation.navigate('settings', {
|
||||
screen: RouteNames.RevengePlugins,
|
||||
params,
|
||||
)
|
||||
})
|
||||
}}
|
||||
/>
|
||||
<AlertActionButton variant="secondary" text="Got it" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue