Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async componentDidMount() {
microsoftTeams.initialize();
microsoftTeams.getContext((context) => {
this.userObjectId = context.userObjectId;
// Initialize application insights for logging events and errors.
this.appInsights = getApplicationInsightsInstance(this.telemetry, browserHistory);
this.getCategory();
});
}
public componentWillMount() {
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
public componentWillMount() {
this.updateTheme(this.getQueryVariable('theme'));
this.setState({
fontSize: this.pageFontSize()
});
if (this.inTeams()) {
microsoftTeams.initialize();
} else {
}
}
constructor() {
microsoftTeams.initialize();
}
public componentWillMount() {
this.updateTheme(this.getQueryVariable("theme"));
this.setState({
fontSize: this.pageFontSize()
});
if (this.inTeams()) {
microsoftTeams.initialize();
} else {
}
}