Quick connect alerts

This commit is contained in:
Simon Caron
2025-01-01 20:29:39 -05:00
parent 40b8410390
commit 34fc26ed18
3 changed files with 23 additions and 12 deletions

View File

@@ -42,8 +42,8 @@ export default function settings() {
const openQuickConnectAuthCodeInput = () => {
Alert.prompt(
"Quick connect",
"Enter the quick connect code",
t("home.settings.quick_connect.quick_connect_title"),
t("home.settings.quick_connect.enter_the_quick_connect_code"),
async (text) => {
if (text) {
try {
@@ -55,14 +55,14 @@ export default function settings() {
Haptics.notificationAsync(
Haptics.NotificationFeedbackType.Success
);
Alert.alert("Success", "Quick connect authorized");
Alert.alert(t("home.settings.quick_connect.success"), t("home.settings.quick_connect.quick_connect_autorized"));
} else {
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
Alert.alert("Error", "Invalid code");
Alert.alert(t("home.settings.quick_connect.error"), t("home.settings.quick_connect.invalid_code"));
}
} catch (e) {
Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
Alert.alert("Error", "Invalid code");
Alert.alert(t("home.settings.quick_connect.error"), t("home.settings.quick_connect.invalid_code"));
}
}
}

View File

@@ -162,8 +162,8 @@ const CredentialsSchema = z.object({
if (result === undefined) {
Alert.alert(
"Connection failed",
"Could not connect to the server. Please check the URL and your network connection."
t("login.connection_failed"),
t("login.could_not_connect_to_server")
);
return;
}
@@ -175,14 +175,14 @@ const CredentialsSchema = z.object({
try {
const code = await initiateQuickConnect();
if (code) {
Alert.alert("Quick Connect", `Enter code ${code} to login`, [
Alert.alert(t("login.quick_connect"), t("login.enter_code_to_login", {code: code}), [
{
text: "Got It",
text: t("login.got_it"),
},
]);
}
} catch (error) {
Alert.alert(t("login.error_title"), "Failed to initiate Quick Connect");
Alert.alert(t("login.error_title"), t("login.failed_to_initiate_quick_connect"));
}
};

View File

@@ -7,7 +7,13 @@
"username_placeholder": "Username",
"password_placeholder": "Password",
"use_quick_connect": "Use Quick Connect",
"login_button": "Log in"
"login_button": "Log in",
"quick_connect": "Quick Connect",
"enter_code_to_login": "Enter code {{code}} to login",
"failed_to_initiate_quick_connect": "Failed to initiate Quick Connect",
"got_it": "Got it",
"connection_failed": "Connection failed",
"could_not_connect_to_server": "Could not connect to the server. Please check the URL and your network connection."
},
"server": {
"enter_url_to_jellyfin_server": "Enter the URL to your Jellyfin server",
@@ -38,7 +44,12 @@
},
"quick_connect": {
"quick_connect_title": "Quick connect",
"authorize_button": "Authorize"
"authorize_button": "Authorize",
"enter_the_quick_connect_code": "Enter the Quick Connect code",
"success": "Success",
"quick_connect_autorized": "Quick Connect authorized",
"error": "Error",
"invalid_code": "Invalid code"
},
"media": {
"media_title": "Media",