reload node config when reload window
This commit is contained in:
1 parent
5fb3a650fb
commit
5fb19c5c08
7 files changed
+66
-17
No files matched your search
@@ -351,7 +351,13 @@ export const Editor: FC<EditorProps> = ({ onChange, data: editor, ...props }) =>
|
||||
}
|
||||
});
|
||||
}
|
||||
}, [editorSize, workspace.editing, graph, t]);
|
||||
}, [editorSize, workspace.editing, graph]);
|
||||
|
||||
useEffect(() => {
|
||||
if (graph) {
|
||||
graph.refresh();
|
||||
}
|
||||
}, [t]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -481,7 +481,7 @@ const alertDeleteFile = (path: string) => {
|
||||
if (path === workspace.editing?.path) {
|
||||
workspace.close(path);
|
||||
}
|
||||
ipcRenderer.invoke("trashItem", path);
|
||||
ipcRenderer.invoke("trash-item", path);
|
||||
}}
|
||||
>
|
||||
{i18n.t("moveToTrash")}
|
||||
@@ -526,7 +526,7 @@ const alertDeleteFolder = (path: string) => {
|
||||
workspace.close(editor.path);
|
||||
}
|
||||
});
|
||||
ipcRenderer.invoke("trashItem", path);
|
||||
ipcRenderer.invoke("trash-item", path);
|
||||
alert.destroy();
|
||||
}}
|
||||
>
|
||||
@@ -812,7 +812,7 @@ export const Explorer: FC = () => {
|
||||
break;
|
||||
}
|
||||
case "revealFile":
|
||||
ipcRenderer.invoke("showItemInFolder", node.path);
|
||||
ipcRenderer.invoke("show-item-in-folder", node.path);
|
||||
break;
|
||||
case "rename": {
|
||||
if (b3util.isTreeFile(node.path)) {
|
||||
|
||||
@@ -29,8 +29,8 @@ const getFocusedWebContents = () => {
|
||||
return BrowserWindow.getFocusedWindow()?.webContents;
|
||||
};
|
||||
|
||||
ipcRenderer.on("open-project", (_, dir) => {
|
||||
useWorkspace.getState().init(dir);
|
||||
ipcRenderer.on("open-project", (_, dir, files) => {
|
||||
useWorkspace.getState().init(dir, files);
|
||||
});
|
||||
|
||||
ipcRenderer.on("refresh-app-men", () => {
|
||||
|
||||
@@ -50,7 +50,7 @@ const calcTextWith = (text: string, fontSize?: string) => {
|
||||
const metrics = ctx.measureText(text);
|
||||
width = metrics.width;
|
||||
// width = width - (isMacos ? 1.6 : 0.8);
|
||||
width *= isMacos ? 0.88 : 0.95;
|
||||
width *= isMacos ? 0.88 : 0.98;
|
||||
textWidthMap.set(key, width);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ipcRenderer } from "electron";
|
||||
import { FC } from "react";
|
||||
import { useSetting } from "../contexts/setting-context";
|
||||
import { message, setGlobalHooks } from "../misc/hooks";
|
||||
@@ -5,6 +6,7 @@ import { message, setGlobalHooks } from "../misc/hooks";
|
||||
export const Setup: FC = () => {
|
||||
if (!message) {
|
||||
useSetting().load();
|
||||
ipcRenderer.invoke("ready-to-show");
|
||||
}
|
||||
setGlobalHooks();
|
||||
return <div></div>;
|
||||
|
||||
Reference in new issue
Block a user