Skip to content

Commit

Permalink
Merge pull request #4268 from nymtech/refactor/vpn_desktop_minor
Browse files Browse the repository at this point in the history
refactor(vpn-desktop): minor changes
  • Loading branch information
zaneschepke authored Dec 20, 2023
2 parents 2c731cf + 2c820ca commit 46d68e5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
7 changes: 1 addition & 6 deletions nym-vpn/ui/src-tauri/src/commands/node_location.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use tauri::State;
use tracing::{debug, instrument};
use ts_rs::TS;

use crate::{
country::DEFAULT_NODE_LOCATION,
error::{CmdError, CmdErrorSource},
states::{app::Country, SharedAppData, SharedAppState},
};
Expand All @@ -15,11 +15,6 @@ pub enum NodeType {
Exit,
}

static DEFAULT_NODE_LOCATION: Lazy<Country> = Lazy::new(|| Country {
code: "DE".to_string(),
name: "Germany".to_string(),
});

#[instrument(skip(app_state, data_state))]
#[tauri::command]
pub async fn set_node_location(
Expand Down
15 changes: 12 additions & 3 deletions nym-vpn/ui/src-tauri/src/country.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,29 @@ use crate::states::app::Country;
pub static COUNTRIES: Lazy<Vec<Country>> = Lazy::new(|| {
vec![
Country {
name: "Ireland".to_string(),
code: "IE".to_string(),
name: "France".to_string(),
code: "FR".to_string(),
},
Country {
name: "Germany".to_string(),
code: "DE".to_string(),
},
Country {
name: "Ireland".to_string(),
code: "IE".to_string(),
},
Country {
name: "Japan".to_string(),
code: "JP".to_string(),
},
Country {
name: "Great Britain".to_string(),
name: "United Kingdom".to_string(),
code: "GB".to_string(),
},
]
});

pub static DEFAULT_NODE_LOCATION: Lazy<Country> = Lazy::new(|| Country {
code: "FR".to_string(),
name: "France".to_string(),
});
2 changes: 1 addition & 1 deletion nym-vpn/ui/src/pages/location/QuickConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function QuickConnect({ onClick }: QuickConnectProps) {
}
>
<span className="font-icon text-2xl px-4 cursor-pointer">bolt</span>
<div className="cursor-pointer">{`${QuickConnectPrefix} ${defaultNodeLocation.name}`}</div>
<div className="cursor-pointer">{`${QuickConnectPrefix} (${defaultNodeLocation.name})`}</div>
</div>
);
}
6 changes: 3 additions & 3 deletions nym-vpn/ui/src/ui/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useMemo, useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { AppName, routes } from '../constants';
import { routes } from '../constants';
import { Routes } from '../types';

type NavLocation = {
Expand All @@ -22,7 +22,7 @@ export default function TopBar() {
const { t } = useTranslation();

const [currentNavLocation, setCurrentNavLocation] = useState<NavLocation>({
title: AppName,
title: '',
rightIcon: 'settings',
handleRightNav: () => {
navigate(routes.settings);
Expand All @@ -32,7 +32,7 @@ export default function TopBar() {
const navBarData = useMemo<NavBarData>(() => {
return {
'/': {
title: AppName,
title: '',
rightIcon: 'settings',
handleRightNav: () => {
navigate(routes.settings);
Expand Down

0 comments on commit 46d68e5

Please sign in to comment.