mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Update tabs sample to match finalized API and link to website
This commit is contained in:
@ -17,11 +17,11 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}));
|
||||
context.subscriptions.push(vscode.window.tabGroups.onDidChangeTabs(tabChangeEvent => {
|
||||
// If tabs are closed no longer track their activity
|
||||
for (const removedTab of tabChangeEvent.removed) {
|
||||
for (const removedTab of tabChangeEvent.closed) {
|
||||
activityMap.delete(removedTab);
|
||||
}
|
||||
// Update activity map last active time on changed tabs
|
||||
const changedTabs = [...tabChangeEvent.added, ...tabChangeEvent.changed];
|
||||
const changedTabs = [...tabChangeEvent.opened, ...tabChangeEvent.changed];
|
||||
for (const tab of changedTabs) {
|
||||
// Reset the timer for the tabs last activity
|
||||
activityMap.set(tab, Date.now());
|
||||
|
||||
Reference in New Issue
Block a user