From 612136d84887d5452f808903b98aa8dd3925a6b3 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Tue, 18 Feb 2025 19:09:07 +0800 Subject: [PATCH] Handle when move to the current folder --- static/js/managers/MoveManager.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/js/managers/MoveManager.js b/static/js/managers/MoveManager.js index 2fc549d3..e1ffe6e7 100644 --- a/static/js/managers/MoveManager.js +++ b/static/js/managers/MoveManager.js @@ -100,6 +100,12 @@ class MoveManager { targetPath = `${targetPath}/${newFolder}`; } + // show toast if current path is same as target path + if (this.currentFilePath.substring(0, this.currentFilePath.lastIndexOf('/')) === targetPath) { + showToast('Model is already in the selected folder', 'info'); + return; + } + try { const response = await fetch('/api/move_model', { method: 'POST',