mirror of
https://github.com/cupcakearmy/unpixel.git
synced 2025-09-02 08:50:40 +00:00
cleanup
This commit is contained in:
@@ -30,7 +30,7 @@ export default class TrayUtility {
|
||||
|
||||
static setStatus(status: string) {
|
||||
this.menu[0].label = status
|
||||
this.tray.setContextMenu(this.build())
|
||||
this.tray?.setContextMenu(this.build())
|
||||
}
|
||||
|
||||
private static build() {
|
||||
|
@@ -20,8 +20,9 @@ export default class Updater {
|
||||
url,
|
||||
})
|
||||
// parse tags and reverse sort them to get the highest
|
||||
const tags = data.map((d) => semver.coerce(d.name)).sort(semver.rcompare)
|
||||
const tags = data.map((d: any) => semver.coerce(d.name)).sort(semver.rcompare)
|
||||
const latest = tags[0]
|
||||
if (!current) throw new Error('Could not determine current version')
|
||||
if (semver.lt(current, latest)) {
|
||||
logger.info('New version available')
|
||||
dialog
|
||||
|
@@ -7,15 +7,17 @@ import { render } from 'react-dom'
|
||||
// @ts-ignore
|
||||
import chime from 'url:../assets/chime.mp3'
|
||||
|
||||
const useKeyPress = (handler) => {
|
||||
const handlerRef = useRef<(e: KeyboardEvent) => void>()
|
||||
const useKeyPress = (handler: (e: KeyboardEvent) => void) => {
|
||||
const handlerRef = useRef<typeof handler>()
|
||||
|
||||
useEffect(() => {
|
||||
handlerRef.current = handler
|
||||
}, [handler])
|
||||
|
||||
useEffect(() => {
|
||||
const fn = (event) => handlerRef.current(event)
|
||||
const fn = (event: KeyboardEvent) => {
|
||||
if (handlerRef.current) handlerRef.current(event)
|
||||
}
|
||||
window.addEventListener('keydown', fn)
|
||||
return () => {
|
||||
window.removeEventListener('keydown', fn)
|
||||
|
@@ -1,4 +1,3 @@
|
||||
/* @import 'hiq/dist/hiq.css'; */
|
||||
@import 'spectre.css/dist/spectre.min.css';
|
||||
@import 'tachyons/css/tachyons.min.css';
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback } from 'react'
|
||||
import React from 'react'
|
||||
|
||||
import Link from './ExternalLink'
|
||||
|
||||
|
Reference in New Issue
Block a user