Skip to content

Commit

Permalink
iOS: Fix Tor fail dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjoberg committed Feb 18, 2022
1 parent ff707d1 commit d9da0a4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/state/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NativeModules, PlatformColor } from "react-native";
import { AlertButton, NativeModules, PlatformColor } from "react-native";
import { Thunk, thunk, Action, action } from "easy-peasy";
import { SQLiteDatabase } from "react-native-sqlite-storage";
import { generateSecureRandom } from "react-native-securerandom";
Expand Down Expand Up @@ -211,14 +211,19 @@ export const model: IStoreModel = {
const restartText = "Restart app and try again with Tor";
const continueText = "Continue without Tor";

const buttons: AlertButton[] = [{
text: continueText,
}];
if (PLATFORM === "android") {
buttons.unshift({
text: restartText,
});
}

const result = await Alert.promiseAlert(
"",
"Tor failed to start.\nThe following error was returned:\n\n" + e.message,
[{
text: restartText,
}, {
text: continueText,
}]
buttons,
);

if (result.text === restartText) {
Expand Down

1 comment on commit d9da0a4

@vercel
Copy link

@vercel vercel bot commented on d9da0a4 Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.