Convert dock_icon.js to TypeScript
This commit is contained in:
parent
932e44e3bf
commit
f404904a49
4 changed files with 20 additions and 24 deletions
|
@ -1,20 +0,0 @@
|
|||
// Copyright 2018-2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
const { app } = require('electron');
|
||||
|
||||
const dockIcon = {};
|
||||
|
||||
dockIcon.show = () => {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.show();
|
||||
}
|
||||
};
|
||||
|
||||
dockIcon.hide = () => {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.hide();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = dockIcon;
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2017-2020 Signal Messenger, LLC
|
||||
// Copyright 2017-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
const path = require('path');
|
||||
|
||||
const fs = require('fs');
|
||||
const { app, Menu, Tray } = require('electron');
|
||||
const dockIcon = require('./dock_icon');
|
||||
const dockIcon = require('../ts/dock_icon');
|
||||
|
||||
let trayContextMenu = null;
|
||||
let tray = null;
|
||||
|
|
4
main.js
4
main.js
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017-2020 Signal Messenger, LLC
|
||||
// Copyright 2017-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/* eslint-disable no-console */
|
||||
|
@ -85,7 +85,7 @@ const attachmentChannel = require('./app/attachment_channel');
|
|||
const bounce = require('./ts/services/bounce');
|
||||
const updater = require('./ts/updater/index');
|
||||
const createTrayIcon = require('./app/tray_icon');
|
||||
const dockIcon = require('./app/dock_icon');
|
||||
const dockIcon = require('./ts/dock_icon');
|
||||
const ephemeralConfig = require('./app/ephemeral_config');
|
||||
const logging = require('./app/logging');
|
||||
const sql = require('./ts/sql/Server').default;
|
||||
|
|
16
ts/dock_icon.ts
Normal file
16
ts/dock_icon.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2018-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { app } from 'electron';
|
||||
|
||||
export function show(): void {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.show();
|
||||
}
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
if (process.platform === 'darwin') {
|
||||
app.dock.hide();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue