Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/remove recurring angular call #1153

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions app/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global angular */
(function () {
const { ipcRenderer } = require('electron');
const ActivityManager = require('./notifications/activityManager');
Expand All @@ -10,36 +9,8 @@

new ActivityManager(ipcRenderer, config).start();

document.addEventListener('DOMContentLoaded', () => {
modifyAngularSettingsWithTimeout();
});
});

function disablePromoteStuff(injector) {
injector.get('settingsService').appConfig.promoteMobile = false;
injector.get('settingsService').appConfig.promoteDesktop = false;
injector.get('settingsService').appConfig.hideGetAppButton = true;
injector.get('settingsService').appConfig.enableMobileDownloadMailDialog = false;
}

function modifyAngularSettingsWithTimeout() {
setTimeout(() => {
try {
let injector = angular.element(document).injector();

if (injector) {
disablePromoteStuff(injector);

injector.get('settingsService').settingsService.refreshSettings();
}
} catch (error) {
if (error instanceof ReferenceError) {
modifyAngularSettingsWithTimeout();
}
}
}, 4000);
}

Object.defineProperty(navigator.serviceWorker, 'register', {
value: () => {
return Promise.reject();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "1.4.14",
"version": "1.4.15",
"main": "app/index.js",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
Expand Down
Loading