mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
32 lines
679 B
JavaScript
32 lines
679 B
JavaScript
import SystemTray from './system-tray';
|
|
const platform = process.platform;
|
|
|
|
let systemTray;
|
|
let unsubConfig = ()=>{};
|
|
|
|
export function deactivate() {
|
|
if (systemTray) {
|
|
systemTray.destroy();
|
|
systemTray = null;
|
|
}
|
|
unsubConfig();
|
|
}
|
|
|
|
const onSystemTrayToggle = (showSystemTray)=> {
|
|
deactivate();
|
|
if (showSystemTray.newValue) {
|
|
systemTray = new SystemTray(platform);
|
|
}
|
|
};
|
|
|
|
export function activate() {
|
|
deactivate();
|
|
unsubConfig = NylasEnv.config.onDidChange('core.workspace.systemTray', onSystemTrayToggle).dispose;
|
|
if (NylasEnv.config.get('core.workspace.systemTray')) {
|
|
systemTray = new SystemTray(platform);
|
|
}
|
|
}
|
|
|
|
export function serialize() {
|
|
|
|
}
|