Skip to content

Commit

Permalink
fix: check system env.
Browse files Browse the repository at this point in the history
Signed-off-by: 1111mp <[email protected]>
  • Loading branch information
1111mp committed Jul 29, 2023
1 parent 3c3cdc7 commit 395ae88
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
"package": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never",
"package:debug": "ts-node ./.erb/scripts/clean.js dist && cross-env DEBUG_PROD=true npm run build && electron-builder build --publish never",
"publish": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish always",
"publish": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish always -mwl",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app",
"start": "ts-node ./.erb/scripts/check-port-in-use.js && npm run start:renderer",
"start:main": "cross-env NODE_ENV=development electronmon -r ts-node/register/transpile-only .",
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ app
.whenReady()
.then(async () => {
try {
// await checkEnv();
await checkEnv();
} catch (err) {}

createWindow();
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/pages/home/tip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Tip = forwardRef<Ref, Props>(({}, ref) => {
<Drawer
open={open}
title="Tip"
width={478}
width={window.Context.platform === 'win32' ? 478 : undefined}
closable={false}
destroyOnClose
onClose={() => {
Expand Down
7 changes: 5 additions & 2 deletions src/renderer/pages/versions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const Versions: React.FC = () => {
const [allVersions, allInstalledVersions, currentVersion] =
useLoaderData() as VersionsResult;

const { version: latest } = allVersions[0];

const [current, setCurrent] = useState<string>(() => currentVersion);
const [versions, setVersions] = useState<Nvmd.Versions>(() => allVersions);
const [installedVersions, setInstalledVersions] = useState<string[]>(
Expand All @@ -63,6 +65,7 @@ export const Versions: React.FC = () => {

const searchInput = useRef<InputRef>(null);
const modal = useRef<InfoRef>(null);
const latestVersion = useRef<string>(latest);

const [messageApi, contextHolder] = message.useMessage();

Expand Down Expand Up @@ -175,13 +178,13 @@ export const Versions: React.FC = () => {
title: 'Version',
dataIndex: 'version',
...getColumnSearchProps('version'),
render: (text: string, { lts }, index: number) => {
render: (text: string, { lts, version }, index: number) => {
return (
<Space>
<span style={{ fontWeight: 500 }}>{text}</span>
{lts ? (
<span style={{ color: '#b9b9b9' }}>({lts})</span>
) : index === 0 ? (
) : latestVersion.current === version ? (
<span style={{ color: '#b9b9b9' }}>(latest)</span>
) : null}
</Space>
Expand Down

0 comments on commit 395ae88

Please sign in to comment.