From 897054935779cb6f7ad3d420cab65390d4e98df1 Mon Sep 17 00:00:00 2001 From: RotPublic <63988781+xiaoyixin-cmd@users.noreply.github.com> Date: Fri, 18 Nov 2022 19:32:23 +0800 Subject: [PATCH] fileNames (#1161) --- frontend/packages/core/src/pages/x2paddle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/packages/core/src/pages/x2paddle.tsx b/frontend/packages/core/src/pages/x2paddle.tsx index 69d6adca..b0a5b6ac 100644 --- a/frontend/packages/core/src/pages/x2paddle.tsx +++ b/frontend/packages/core/src/pages/x2paddle.tsx @@ -177,7 +177,7 @@ function App() { console.log('Graph.current.filess', Graph); const Graphs: any = Graph; const files: FileList | null = Graphs?.current?.files as FileList; - const name = files[0].name.split('.')[1]; + const name = files[0].name.substring(files[0].name.lastIndexOf('.') + 1); if (name === 'prototxt') { toast.warning(t('togglegraph:warin-info')); if (file.current) { -- GitLab