From 4968452003ef1b39670be56c6eae559be737a3c3 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 9 Jan 2025 02:22:54 -0800 Subject: [PATCH] proper warning --- .../browser/react/src/void-settings-tsx/ModelDropdown.tsx | 2 +- .../void/browser/react/src/void-settings-tsx/Settings.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx index 5ee372c8..91191694 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/ModelDropdown.tsx @@ -90,7 +90,7 @@ const MemoizedModelSelectBox = ({ featureName }: { featureName: FeatureName }) = } -const WarningBox = ({ text, className }: { text: string, className?: string }) => { +export const WarningBox = ({ text, className }: { text: string, className?: string }) => { const accessor = useAccessor() const commandService = accessor.get('ICommandService') diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx index 21986a0f..8333bc5e 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-settings-tsx/Settings.tsx @@ -15,6 +15,7 @@ import { useScrollbarStyles } from '../util/useScrollbarStyles.js' import { isWindows, isLinux, isMacintosh } from '../../../../../../../base/common/platform.js' import { URI } from '../../../../../../../base/common/uri.js' import { env } from '../../../../../../../base/common/process.js' +import { WarningBox } from './ModelDropdown.js' const SubtleButton = ({ onClick, text, icon, disabled }: { onClick: () => void, text: string, icon: React.ReactNode, disabled: boolean }) => { @@ -486,7 +487,7 @@ const transferTheseFilesOfOS = (os: 'mac' | 'windows' | 'linux' | null): Transfe throw new Error(`os '${os}' not recognized`) } -const os = null//isWindows ? 'windows' : isMacintosh ? 'mac' : isLinux ? 'linux' : null +const os = isWindows ? 'windows' : isMacintosh ? 'mac' : isLinux ? 'linux' : null let transferTheseFiles: TransferFilesInfo = [] let transferError: string | null = null @@ -499,8 +500,7 @@ const OneClickSwitch = () => { if (transferTheseFiles.length === 0) return <> -
One-click transfer not available.
-
{transferError}
+ const onClick = async () => {