From 8a750d4692418a9c4209b66a493f6c136658fc89 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sat, 25 Sep 2021 11:55:59 +0300 Subject: [PATCH] File searcher: fix FileManager invocation (#8257) Do not start a new instance if not needed. --- frontend/apps/filemanager/filemanagerfilesearcher.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/apps/filemanager/filemanagerfilesearcher.lua b/frontend/apps/filemanager/filemanagerfilesearcher.lua index 5ba593745..66875b271 100644 --- a/frontend/apps/filemanager/filemanagerfilesearcher.lua +++ b/frontend/apps/filemanager/filemanagerfilesearcher.lua @@ -214,10 +214,12 @@ function FileSearcher:onMenuHold(item) callback = function() UIManager:close(self.results_dialog) self.close_callback() - if is_file then - FileManager:showFiles(item.dir, fullpath) + local focused_path = is_file and item.dir or fullpath + local focused_file = is_file and fullpath or nil + if FileManager.instance then + FileManager.instance:reinit(focused_path, focused_file) else - FileManager:showFiles(fullpath) + FileManager:showFiles(focused_path, focused_file) end end, },