Skip to content

Commit

Permalink
Refactor more
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvNC committed Jul 25, 2023
1 parent f776ebe commit 3c98c60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions src/utils/checkUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ const platform = process.platform;
* Checks if the operating system is MacOS or Linux and if there are updates available.
* Returns the version number of the latest release if there are updates available. Otherwise, returns null.
* Also does not check for updates if the last update check was less than five minutes ago.
* @param {Store} config
* @returns {Promise<string|null>} The version number of the latest release if there are updates available. Otherwise, returns false.
* @returns The version number of the latest release if there are updates available. Otherwise, returns false.
*/

async function checkUpdate(config: ElectronStore) {
async function checkUpdate(config: ElectronStore): Promise<string | false> {
// Do not check if Windows
if (platform === 'win32') {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/sqlHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sqlite3 from 'sqlite3';
const sqlHandler = {
db: null as sqlite3.Database | null,
init: function (path: string) {
this.db = new sqlite3.Database(path, (err: Error | null) => {
this.db = new sqlite3.Database(path, (err) => {
if (err) {
console.error(err.message);
}
Expand Down
8 changes: 2 additions & 6 deletions src/utils/stickerHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, clipboard, nativeImage } from 'electron';
import { BrowserWindow, app, clipboard, nativeImage } from 'electron';
import fs from 'fs';
import path from 'path';
import { keyboard, Key } from '@nut-tree/nut-js';
Expand Down Expand Up @@ -91,11 +91,7 @@ function getAllStickerPacks(stickerPacksDir: string) {
*/
async function pasteStickerFromPath(
stickerPath: any,
window: {
minimize: () => void;
setAlwaysOnTop: (arg0: boolean) => void;
setFocusable: (arg0: boolean) => void;
},
window: BrowserWindow,
{
closeWindowAfterSend = true,
resizeWidth = 160,
Expand Down

0 comments on commit 3c98c60

Please sign in to comment.