Skip to content

Commit

Permalink
1.0.30 studio bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaobaidadada committed Jan 2, 2025
1 parent fef374a commit dca5848
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filecat",
"version": "1.0.29",
"version": "1.0.30",
"description": "filecat 文件管理器",
"author": "xiaobaidadada",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/web/project/component/file/component/FileEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function FileEditor() {
}
async function save() {
if (editorSetting.save && have_update) {
await editorSetting.save(editor_data.get_deitor_value() );
await editorSetting.save(editor_data.get_editor_value() );
editor_data.set_value_temp('');
// NotySucess("保存成功")
set_have_update(false);
Expand Down
7 changes: 3 additions & 4 deletions src/web/project/component/file/component/studio/Studio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default function Studio(props) {
const [nav_width, set_nav_width] = useState(16);
const [showPrompt, setShowPrompt] = useRecoilState($stroe.showPrompt);
const {t} = useTranslation();
const [editor,set_editor] = useState(undefined);

function shellClick() {
if (file_shell_hidden !== undefined) {
Expand Down Expand Up @@ -128,7 +127,7 @@ export default function Studio(props) {
return;
}
const data: saveTxtReq = {
context: editor.getValue()
context: editor_data.get_editor_value()
}
const rsq = await fileHttp.post(`save/${edit_file_path}`, data)
if (rsq.code === 0) {
Expand Down Expand Up @@ -246,7 +245,7 @@ export default function Studio(props) {
width: `${nav_width - 1}em`,
}}
onContextMenu={(event) => {
handleContextMenu(event, edit_filename.name, getRouterAfter('file', studio.folder_path), true, get_item)
handleContextMenu(event, edit_filename.name, getRouterAfter('file', studio.folder_path), true, get_item)
}}
>
<FolderTree pre_path={pre_path} list={list} click={click} handleContextMenu={handleContextMenu} fatherNowToggleExpansion={get_item}/>
Expand All @@ -259,7 +258,7 @@ export default function Studio(props) {
/>
}
<div className={"studio-editor"} key={edit_filename.path}>
{edit_filename.name && <Ace name={edit_filename.name} on_change={change} init={(v)=>set_editor(v)}/>}
{edit_filename.name && <Ace name={edit_filename.name} on_change={change} />}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/web/project/util/store.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class editor_data {
editor_data.editor = v;
}

public static get_deitor_value() {
public static get_editor_value() {
if (!editor_data.editor) {
throw "不存在编辑器";
}
Expand Down

0 comments on commit dca5848

Please sign in to comment.