Skip to content

Commit

Permalink
Correct compile error on platformIcons keys
Browse files Browse the repository at this point in the history
The compile error was:
TS7053: Element implicitly has an 'any' type because expression of type
'"aix" | "android" | "darwin" | "freebsd" | "openbsd" | "sunos"
| "win32" | "cygwin" | "netbsd"' can't be used to index type
'{ darwin: string; win32: string; }'. Property 'aix' does not exist on
type '{ darwin: string; win32: string; }'.
  • Loading branch information
cskeogh committed May 27, 2021
1 parent a8e12d3 commit b7e3ab4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/app/service-providers/tray-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default class TrayProvider extends EventEmitter {
*/
private _addTray (show: () => void, quit: () => void): void {
if (this._tray == null) {
const platformIcons: { [key in 'darwin' | 'win32']: string } = {
const platformIcons: { [key: string]: string } = {
'darwin': '/png/22x22_white.png',
'win32': '/icon.ico'
}
Expand Down

0 comments on commit b7e3ab4

Please sign in to comment.