Skip to content

Is it possible to restart the application from the modal? #164

Open

Description

@guybridge

Trying to use in conjunction with react-native-restart however once the app has crashed. None of the buttons work.

setJSExceptionHandler((error, isFatal) => { jsExceptionHandler(error, isFatal) })

function jsExceptionHandler(error, isFatal = true) { const msg = access(error, "message") ||Unknown Error: ${JSON.stringify(error, Object.getOwnPropertyNames(error))} if (isFatal) { showExceptionModal(msg) } }

function showExceptionModal(error) { Alert.alert( "Oops...", "It looks like something went wrong and we will need to restart the app.", [ { text: "Restart", onPress: () => { RNRestart.Restart() }, }, { text: "Logout", onPress: () => { AsyncStorage.setItem(REFRESH_TOKEN, "") RNRestart.Restart() }, }, ] ) }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions