Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fontSize: this.pageFontSize()
});
if (this.inTeams()) {
microsoftTeams.initialize();
microsoftTeams.getContext((context: microsoftTeams.Context) => {
this.tenantId = context.tid;
this.selectedOption = context.entityId;
this.setState({
selectedConfiguration: context.entityId
});
this.setValidityState(true);
});
microsoftTeams.settings.registerOnSaveHandler((saveEvent: microsoftTeams.settings.SaveEvent) => {
// Calculate host dynamically to enable local debugging
const host = "https://" + window.location.host;
microsoftTeams.settings.setSettings({
contentUrl: host + "/teamsApp1Tab/?data=",
suggestedDisplayName: "teams app1 Tab",
removeUrl: host + "/teamsApp1Tab/remove.html",
entityId: this.state.selectedConfiguration
});
saveEvent.notifySuccess();
});
} else {
}
}
microsoftTeams.settings.registerOnSaveHandler((saveEvent: microsoftTeams.settings.SaveEvent) => {
// Calculate host dynamically to enable local debugging
const host = "https://" + window.location.host;
microsoftTeams.settings.setSettings({
contentUrl: host + "/teamsApp1Tab/?data=",
suggestedDisplayName: "teams app1 Tab",
removeUrl: host + "/teamsApp1Tab/remove.html",
entityId: this.state.value
});
saveEvent.notifySuccess();
});
} else {
this.updateTheme(this.getQueryVariable("theme"));
this.setState({
fontSize: this.pageFontSize()
});
if (this.inTeams()) {
microsoftTeams.initialize();
microsoftTeams.getContext((context: microsoftTeams.Context) => {
this.setState({
value: context.entityId
});
this.setValidityState(true);
});
microsoftTeams.settings.registerOnSaveHandler((saveEvent: microsoftTeams.settings.SaveEvent) => {
// Calculate host dynamically to enable local debugging
const host = "https://" + window.location.host;
microsoftTeams.settings.setSettings({
contentUrl: host + "/teamsApp1Tab/?data=",
suggestedDisplayName: "teams app1 Tab",
removeUrl: host + "/teamsApp1Tab/remove.html",
entityId: this.state.value
});
saveEvent.notifySuccess();
});
} else {
}
}
microsoftTeams.settings.registerOnSaveHandler((saveEvent: microsoftTeams.settings.SaveEvent) => {
// Calculate host dynamically to enable local debugging
const host = "https://" + window.location.host;
microsoftTeams.settings.setSettings({
contentUrl: host + "/teamsApp1Tab/?data=",
suggestedDisplayName: "teams app1 Tab",
removeUrl: host + "/teamsApp1Tab/remove.html",
entityId: this.state.selectedConfiguration
});
saveEvent.notifySuccess();
});
} else {
initialize({ groupId, upn}) {
this.setState({ groupId, upn });
console.log(this.state);
/** Enable the Save button */
microsoftTeams.settings.setValidityState(true);
/** Register the save handler */
microsoftTeams.settings.registerOnSaveHandler(saveEvent => {
/** Store Tab content settings */
microsoftTeams.settings.setSettings({
entityId:"Microsoft_todo_sample_app",
contentUrl: `${location.origin}/index.html`,
suggestedDisplayName: "My Tasks",
websiteUrl: `${location.origin}/index.html`
});
saveEvent.notifySuccess();
});
}
}
microsoftTeams.settings.registerOnSaveHandler(saveEvent => {
/** Store Tab content settings */
microsoftTeams.settings.setSettings({
entityId:"Microsoft_todo_sample_app",
contentUrl: `${location.origin}/index.html`,
suggestedDisplayName: "My Tasks",
websiteUrl: `${location.origin}/index.html`
});
saveEvent.notifySuccess();
});
}