Remebering last team fix to old version.

This commit is contained in:
Ruturaj Hagawane 2020-01-14 17:15:25 -05:00
Родитель 4ccf8b8dd6
Коммит 2c50f892c0
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "team-calendar",
"publisher": "ms-devlabs",
"version": "2.0.14",
"version": "2.0.22",
"name": "Team Calendar",
"description": "Track events important to your team, view and manage days off, quickly see when sprints start and end, and more.",
"public": true,

Просмотреть файл

@ -149,17 +149,17 @@ export class CalendarStateManagerComponent extends BaseComponent<
const navSvc = await VSS.getService<IHostNavigationService>(VSS.ServiceIds.Navigation);
let selectedTeamId = (await navSvc.getCurrentState()).team;
if (!selectedTeamId) {
// Nothing in URL - check context
// Nothing in URL - check data service
const dataSvc = await VSS.getService<IExtensionDataService>(VSS.ServiceIds.ExtensionData);
selectedTeamId = await dataSvc.getValue<string>("selected-team-" + VSS.getWebContext().project.id, { scopeType: "User" });
}
if (!selectedTeamId) {
// Nothing in URL or data service - check context
const contextTeam = VSS.getWebContext().team;
if (contextTeam && contextTeam.id) {
selectedTeamId = contextTeam.id;
}
}
if (!selectedTeamId) {
// Nothing in URL or context - check data service
const dataSvc = await VSS.getService<IExtensionDataService>(VSS.ServiceIds.ExtensionData);
selectedTeamId = await dataSvc.getValue<string>("selected-team", { scopeType: "User" });
}
if (selectedTeamId) {
// get the team if we found a way to choose one
const team = await Tfs_Core_WebApi.getClient().getTeam(VSS.getWebContext().project.id, selectedTeamId);
@ -180,7 +180,7 @@ export class CalendarStateManagerComponent extends BaseComponent<
navSvc.updateHistoryEntry(null, { team: selectedTeam.id }, true, true, null, false);
const dataSvc = await VSS.getService<IExtensionDataService>(VSS.ServiceIds.ExtensionData);
dataSvc.setValue<string>("selected-team", selectedTeam.id, { scopeType: "User" });
dataSvc.setValue<string>("selected-team-" + VSS.getWebContext().project.id, selectedTeam.id, { scopeType: "User" });
this.setState({ selectedTeam });
}