Skip to content

Commit

Permalink
package.json fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeiel Lima Miranda committed Nov 28, 2024
1 parent fb36c35 commit dd848f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const path = require("path");
let tray = null; // Variável para armazenar a instância da bandeja
let win = null; // Variável para armazenar a instância da janela

// Função para resolver caminhos absolutos
const resolveAssetPath = (asset) =>
app.isPackaged
? path.join(process.resourcesPath, asset)
: path.join(__dirname, asset);

function createWindow() {
win = new BrowserWindow({
width: 400,
Expand Down Expand Up @@ -55,7 +61,7 @@ app.whenReady().then(() => {
createWindow();

// Criar a bandeja
tray = new Tray(path.join(__dirname, "logo.png")); // Substitua pelo caminho do seu ícone
tray = new Tray(resolveAssetPath("logo.png")); // Caminho dinâmico para o logo
const contextMenu = Menu.buildFromTemplate([
{
label: "Abrir",
Expand Down

0 comments on commit dd848f7

Please sign in to comment.