Skip to content

Commit

Permalink
Merge pull request #7 from IsmaelMartinez/0.1.7
Browse files Browse the repository at this point in the history
0.1.7
  • Loading branch information
IsmaelMartinez authored Oct 29, 2018
2 parents 5c43844 + 3367c28 commit 86f828c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
12 changes: 5 additions & 7 deletions app/lib/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
const path = require('path');
const { ipcRenderer } = require('electron');
const trayNotifications = require('./tray-notifications');
// const nativeNotifications = require('./native-notifications');
require('./zoom')();

const iconPath = path.join(__dirname, '../assets/icons/icon-96x96.png');
Expand All @@ -14,10 +13,9 @@
iconPath
});

// document.addEventListener(
// 'DOMContentLoaded',
// nativeNotifications({
// ipc: ipcRenderer,
// iconPath
// }));
//change userAgent to chrome to fix the issue of notifications disapearing.
document.addEventListener(
'DOMContentLoaded',
navigator.__defineGetter__('userAgent', () => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/12.246')
);
})();
2 changes: 1 addition & 1 deletion app/lib/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function argv(configPath) {
describe: 'Microsoft Edge User Agent',
type: 'string',
default:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134'
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/12.246'
},
chromeUserAgent: {
describe: 'Google Chrome User Agent',
Expand Down
14 changes: 7 additions & 7 deletions app/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const NativeNotification = require('electron-native-notification');
const Menus = require('./menus');
const configBuilder = require('./config');

function createWindow(config, iconPath) {
function createWindow(part, iconPath) {
// Load the previous state with fallback to defaults
let windowState = windowStateKeeper({
defaultWidth: 0,
Expand All @@ -28,7 +28,7 @@ function createWindow(config, iconPath) {
icon: path.join(__dirname, 'assets', 'icons', 'icon-96x96.png'),

webPreferences: {
partition: config.partition,
partition: part,
preload: path.join(__dirname, 'browser', 'index.js'),
nativeWindowOpen: true,
plugins: true,
Expand All @@ -54,7 +54,7 @@ app.on('ready', () => {
);
let isFirstLoginTry = true;
const config = configBuilder(app.getPath('userData'));
var window = createWindow(config, iconPath);
var window = createWindow(config.partition, iconPath);
let menus = new Menus(config, iconPath);
menus.register(window);

Expand All @@ -64,7 +64,7 @@ app.on('ready', () => {

ipcMain.on('notifications', async (e, msg) => {
if (msg.count > 0) {
const body = "You got " + msg.count + " notification(s). " + ((msg.text) ? " <i>" + msg.text + "</i> " : "");
const body = ((msg.text) ? "(" + msg.count + "): " + msg.text : "You got " + msg.count + " notification(s)");
const notification = new NativeNotification(
"Microsoft Teams",
{
Expand Down Expand Up @@ -93,13 +93,13 @@ app.on('ready', () => {
app.exit(0);
}
});

if (config.userAgent === 'edge') {
window.webContents.setUserAgent(config.edgeUserAgent);
} else {
window.webContents.setUserAgent(config.chromeUserAgent);
}

}
window.once('ready-to-show', () => window.show());

window.webContents.on('did-finish-load', function () {
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teams-for-linux",
"version": "0.1.6",
"version": "0.1.7",
"description": "Microsoft Teams for Linux",
"main": "lib/index.js",
"author": "Ivelin Velkov <[email protected]>",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "teams-for-linux",
"version": "0.1.6",
"version": "0.1.7",
"description": "Unofficial client for Microsoft Teams for Linux",
"homepage": "https://github.com/JamieMagee/teams-for-linux",
"homepage": "https://github.com/IsmaelMartinez/teams-for-linux",
"keywords": [
"Teams",
"Microsoft Teams"
Expand Down

0 comments on commit 86f828c

Please sign in to comment.