Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix duplicate tab when opening from file explorer that already is open
Fixes #569 Opening from the file explorer a trace uses the file URI to open the the trace viewer widget. Then it scans the file system for traces, posts the traces and experiment to the trace server. Only at that point the experiment UUID is known. Theia keeps a map from with a key using URI+TraceWidgetOpenOptions to widget. When opening the first time the open options are undefined and the key is only the URI. Closing the trace that map will cleared. When opening the trace from the trace explorer, the TraceWidgetOpenOption will be populated with the experiment UUID, but the URI is not known anymore. When the user now opens the same trace from same file location, the URI is used but the there is no way to know the corresponding UUID until the trace(s) and experiment is created on the server. The fix provided checks uses this UUID to match the UUID of any widgets that are already open. If an widget is already open it will close the new widget since it's a duplicate. The solution proposed will fix the issue, but a follow-up patch needs to be worked that avoids opening the tab first and closing it when a duplicate is detected. Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
- Loading branch information