Skip to content

Commit

Permalink
chore: style
Browse files Browse the repository at this point in the history
  • Loading branch information
lencx committed May 25, 2023
1 parent 55eb719 commit f50dd4f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions scripts/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ function chatInit() {
currentIndex = -1;
};
}

init();
}

if (document.readyState === 'complete' || document.readyState === 'interactive') {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "ChatGPT",
"version": "1.0.0"
"version": "0.12.0"
},
"tauri": {
"allowlist": {
Expand Down
4 changes: 4 additions & 0 deletions src/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ body,
margin-left: 5px;
}
}

.ant-message {
max-width: 500px;
}
13 changes: 1 addition & 12 deletions src/view/scripts/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,12 @@ export const scriptColumns = ({ scriptsMap }: any) => [
return <a onClick={() => shell.open(uri)}>{uri}</a>;
},
},
{
title: 'Created',
dataIndex: 'created',
key: 'created',
width: 150,
render: fmtDate,
},
{
title: 'Action',
fixed: 'right',
width: 100,
render: (_: any, row: any, actions: any) => {
const isExternal = row.name === 'main.js';

const next = scriptsMap?.[row.name]?.next_version;
const curr = scriptsMap?.[row.name]?.curr_version;

return (
<Space>
<Link
Expand All @@ -74,7 +63,7 @@ export const scriptColumns = ({ scriptsMap }: any) => [
>
Edit
</Link>
{!isExternal && next && next !== curr && (
{!isExternal && (
<Popconfirm
placement="topLeft"
title="Are you sure you want to synchronize? It will overwrite all previous modifications made to this file."
Expand Down
9 changes: 8 additions & 1 deletion src/view/scripts/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { Table } from 'antd';
import { Table, message } from 'antd';
import { path, fs, invoke } from '@tauri-apps/api';

import useInit from '@/hooks/useInit';
Expand Down Expand Up @@ -53,6 +53,13 @@ export default function Scripts() {
if (isOk) {
await handleInit();
opInfo.resetRecord();
message.success(
`The ${opInfo?.opRecord?.name} script has been synchronized successfully`,
);
} else {
message.error(
`The ${opInfo?.opRecord?.name} script synchronization failed. You can try editing the script and click the Remote File link to copy the source code.`,
);
}
}
})();
Expand Down

0 comments on commit f50dd4f

Please sign in to comment.