Skip to content

Commit

Permalink
fix merge weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
shanimal08 committed Oct 22, 2024
1 parent 42f991a commit 631aa4f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 42 deletions.
28 changes: 14 additions & 14 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ version = "0.5.42"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = {version = "1.5.5", features = ["isolation"]}
tauri-build = {version = "1.5.5", features = ["isolation"] }

[dependencies]
anyhow = "1"
async-trait = "0.1.81"
async_zip = {version = "0.0.17", features = ["full"]}
async_zip = {version = "0.0.17", features = ["full"] }
auto-launch = "0.5.0"
blake2 = "0.10"
chrono = "0.4.38"
Expand All @@ -29,26 +29,26 @@ keyring = {version = "3.0.5", features = [
"windows-native",
"apple-native",
"linux-native",
]}
] }
libsqlite3-sys = {version = "0.25.1", features = [
"bundled",
]}# Required for tari_wallet
] }# Required for tari_wallet
log = "0.4.22"
log4rs = "1.3.0"
minotari_node_grpc_client = {git = "https://github.com/tari-project/tari.git", branch = "development"}
minotari_wallet_grpc_client = {git = "https://github.com/tari-project/tari.git", branch = "development"}
nix = {version = "0.29.0", features = ["signal"]}
nix = {version = "0.29.0", features = ["signal"] }
nvml-wrapper = "0.10.0"
open = "5"
phraze = "0.3.15"
rand = "0.8.5"
regex = "1.10.5"
reqwest = {version = "0.12.5", features = ["stream", "json", "multipart"]}
reqwest = {version = "0.12.5", features = ["stream", "json", "multipart"] }
sanitize-filename = "0.5"
semver = "1.0.23"
sentry = {version = "0.34.0", features = ["anyhow"]}
sentry = {version = "0.34.0", features = ["anyhow"] }
sentry-tauri = "0.3.0"
serde = {version = "1", features = ["derive"]}
serde = {version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.10.8"
sys-locale = "0.3.1"
Expand All @@ -58,7 +58,7 @@ tari_common = {git = "https://github.com/tari-project/tari.git", branch = "devel
tari_common_types = {git = "https://github.com/tari-project/tari.git", branch = "development"}
tari_core = {git = "https://github.com/tari-project/tari.git", branch = "development", features = [
"transactions",
]}
] }
tari_crypto = "0.20.3"
tari_key_manager = {git = "https://github.com/tari-project/tari.git", branch = "development"}
tari_shutdown = {git = "https://github.com/tari-project/tari.git", branch = "development"}
Expand All @@ -78,13 +78,13 @@ tauri = {version = "1.8.0", features = [
"isolation",
"shell-open",
"process-command-api",
]}
] }
tauri-plugin-single-instance = {git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1"}
thiserror = "1.0.26"
tokio = {version = "1", features = ["full"]}
tokio-util = {version = "0.7.11", features = ["compat"]}
tokio = {version = "1", features = ["full"] }
tokio-util = {version = "0.7.11", features = ["compat"] }
tor-hash-passwd = "1.0.1"
xz2 = {version = "0.1.7", features = ["static"]}# static bind lzma
xz2 = {version = "0.1.7", features = ["static"] }# static bind lzma
zip = "2.2.0"

[target.'cfg(windows)'.dependencies]
Expand All @@ -93,7 +93,7 @@ winreg = "0.52.0"
# needed for keymanager. TODO: Find a way of creating a keymanager without bundling sqlite
chrono = "0.4.38"
device_query = "2.1.0"
libsqlite3-sys = {version = "0.25.1", features = ["bundled"]}
libsqlite3-sys = {version = "0.25.1", features = ["bundled"] }
log = "0.4.22"
nvml-wrapper = "0.10.0"
rand = "0.8.5"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { AnimatePresence } from 'framer-motion';

import { useUIStore } from '@app/store/useUIStore.ts';
import { useAppConfigStore } from '@app/store/useAppConfigStore.ts';

import { ToggleSwitch } from '@app/components/elements/ToggleSwitch.tsx';
import VisualMode from '@app/containers/Dashboard/components/VisualMode.tsx';

import { SettingsGroup, SettingsGroupWrapper } from '../../components/SettingsGroup.styles.ts';

import AppVersions from './AppVersions.tsx';
import DebugSettings from './DebugSettings.tsx';
import ExperimentalWarning from './ExperimentalWarning.tsx';
import GpuDevices from './GpuDevices.tsx';
import P2pMarkup from './P2pMarkup.tsx';
import { TorMarkup } from './sections/experimental/TorMarkup';
import { TorMarkup } from './TorMarkup';

export const ExperimentalSettings = () => {
const showExperimental = useUIStore((s) => s.showExperimental);
const useTor = useAppConfigStore((s) => s.use_tor);
const setUseTor = useAppConfigStore((s) => s.setUseTor);
const setDialogToShow = useUIStore((s) => s.setDialogToShow);
const { t } = useTranslation('settings', { useSuspense: false });

const toggleUseTor = useCallback(() => {
setUseTor(!useTor).then(() => {
setDialogToShow('restart');
});
}, [setDialogToShow, setUseTor, useTor]);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Typography } from '@app/components/elements/Typography';
import styled from 'styled-components';

export const StyledInput = styled(Input)<{ hasError?: boolean }>(({ theme, hasError }) => ({
borderColor: hasError ? theme.palette.error.main : theme.palette.colors.darkAlpha[10],
borderColor: hasError ? theme.palette.error.main : theme.colorsAlpha.darkAlpha[10],
marginLeft: '15px',
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import { invoke } from '@tauri-apps/api/tauri';
import { Typography } from '@app/components/elements/Typography';
import { TorConfig } from '@app/types/app-status';
import { Input } from '@app/components/elements/inputs/Input';
import { Button } from '@app/components/elements/Button';

import { ErrorTypography, StyledInput, SaveButtonWrapper } from './TorMarkup.styles';
import { Button } from '@app/components/elements/buttons/Button.tsx';

interface EditedTorConfig {
// it's also string here to prevent an empty value
Expand All @@ -26,13 +27,11 @@ interface EditedTorConfig {

const hasBridgeError = (bridge: string) => {
// TODO: How should we validate the bridge? (IPv4, IPv6, different formats)
if (!bridge || bridge.trim().length === 0) return true;
return false;
return !bridge || bridge.trim().length === 0;
};

const hasControlPortError = (cp: number) => {
if (!cp || cp <= 0) return true;
return false;
return !cp || cp <= 0;
};

export const TorMarkup = () => {
Expand Down Expand Up @@ -83,14 +82,12 @@ export const TorMarkup = () => {
if (editedUseTor !== defaultUseTor) return true;

if (JSON.stringify(defaultTorConfig) === JSON.stringify(editedConfig)) return false;
if (
return !(
(editedConfig?.use_bridges &&
(!editedConfig?.bridges?.length || editedConfig?.bridges.some((bridge) => hasBridgeError(bridge))) &&
!editedConfig?.control_port) ||
Number(editedConfig?.control_port) <= 0
)
return false;
return true;
);
}, [defaultTorConfig, defaultUseTor, editedConfig, editedUseTor]);

const toggleUseBridges = useCallback(async () => {
Expand Down

0 comments on commit 631aa4f

Please sign in to comment.