Skip to content

Commit

Permalink
Convert dock_icon.js to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn-Signal authored and scottnonnenberg-signal committed Jan 26, 2021
1 parent 932e44e commit f404904
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
20 changes: 0 additions & 20 deletions app/dock_icon.js

This file was deleted.

4 changes: 2 additions & 2 deletions app/tray_icon.js
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions 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 */
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 16 additions & 0 deletions ts/dock_icon.ts
@@ -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();
}
}

0 comments on commit f404904

Please sign in to comment.