Merge branches 'develop' and 't3chguy/remove_bluebird' of https://github.com/vector-im/riot-web into t3chguy/remove_bluebird

This commit is contained in:
Michael Telatynski 2019-11-22 14:00:02 +00:00
commit eac6c46d28
25 changed files with 527 additions and 110 deletions

View file

@ -199,7 +199,8 @@ export default class ElectronPlatform extends VectorBasePlatform {
}
supportsAutoHideMenuBar(): boolean {
return true;
// This is irelevant on Mac as Menu bars don't live in the app window
return !navigator.platform.toUpperCase().includes('MAC');
}
async getAutoHideMenuBarEnabled(): boolean {

View file

@ -85,9 +85,29 @@ export default class VectorBasePlatform extends BasePlatform {
bgColor = "#f00";
}
this.favicon.badge(notif, {
bgColor: bgColor,
});
const doUpdate = () => {
this.favicon.badge(notif, {
bgColor: bgColor,
});
};
doUpdate();
// HACK: Workaround for Chrome 78+ and dependency incompatibility.
// The library we use doesn't appear to work in Chrome 78, likely due to their
// changes surrounding tab behaviour. Tabs went through a bit of a redesign and
// restructuring in Chrome 78, so it's not terribly surprising that the library
// doesn't work correctly. The library we use hasn't been updated in years and
// does not look easy to fix/fork ourselves - we might as well write our own that
// doesn't include animation/webcam/etc support. However, that's a bit difficult
// so for now we'll just trigger the update twice.
//
// Note that trying to reproduce the problem in isolation doesn't seem to work:
// see https://gist.github.com/turt2live/5ab87919918adbfd7cfb8f1ad10f2409 for
// an example (you'll need your own web server to host that).
if (window.chrome) {
doUpdate();
}
} catch (e) {
console.warn(`Failed to set badge count: ${e.message}`);
}