提交 832f9409 编写于 作者: B Benjamin Pasero

fix #54052

上级 a56ec40e
...@@ -62,29 +62,33 @@ export class HistoryMainService implements IHistoryMainService { ...@@ -62,29 +62,33 @@ export class HistoryMainService implements IHistoryMainService {
const mru = this.getRecentlyOpened(); const mru = this.getRecentlyOpened();
// Workspaces // Workspaces
workspaces.forEach(workspace => { if (Array.isArray(workspaces)) {
const isUntitledWorkspace = !isSingleFolderWorkspaceIdentifier(workspace) && this.workspacesMainService.isUntitledWorkspace(workspace); workspaces.forEach(workspace => {
if (isUntitledWorkspace) { const isUntitledWorkspace = !isSingleFolderWorkspaceIdentifier(workspace) && this.workspacesMainService.isUntitledWorkspace(workspace);
return; // only store saved workspaces if (isUntitledWorkspace) {
} return; // only store saved workspaces
}
mru.workspaces.unshift(workspace);
mru.workspaces = arrays.distinct(mru.workspaces, workspace => this.distinctFn(workspace)); mru.workspaces.unshift(workspace);
mru.workspaces = arrays.distinct(mru.workspaces, workspace => this.distinctFn(workspace));
// We do not add to recent documents here because on Windows we do this from a custom
// JumpList and on macOS we fill the recent documents in one go from all our data later. // We do not add to recent documents here because on Windows we do this from a custom
}); // JumpList and on macOS we fill the recent documents in one go from all our data later.
});
}
// Files // Files
files.forEach((path) => { if (Array.isArray(files)) {
mru.files.unshift(path); files.forEach((path) => {
mru.files = arrays.distinct(mru.files, file => this.distinctFn(file)); mru.files.unshift(path);
mru.files = arrays.distinct(mru.files, file => this.distinctFn(file));
// Add to recent documents (Windows only, macOS later)
if (isWindows) { // Add to recent documents (Windows only, macOS later)
app.addRecentDocument(path); if (isWindows) {
} app.addRecentDocument(path);
}); }
});
}
// Make sure its bounded // Make sure its bounded
mru.workspaces = mru.workspaces.slice(0, HistoryMainService.MAX_TOTAL_RECENT_ENTRIES); mru.workspaces = mru.workspaces.slice(0, HistoryMainService.MAX_TOTAL_RECENT_ENTRIES);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册