Skip to content

Commit

Permalink
fix(suite-desktop-core): update autostart file on linux each launch
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Sep 3, 2024
1 parent 700084e commit 9a0dffc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/suite-desktop-core/src/modules/auto-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const init: Module = () => {

ipcMain.on('app/auto-start', (_, enabled: boolean) => {
logger.debug(SERVICE_NAME, 'Auto start ' + (enabled ? 'enabled' : 'disabled'));

if (process.platform === 'linux') {
// For Linux, we use a custom implementation
linuxAutoStart(enabled);
Expand All @@ -55,4 +54,20 @@ export const init: Module = () => {
});
}
});

return {
onLoad: () => {
// Update autostart file on Linux, since the AppImage might have been moved
if (process.platform === 'linux') {
const autostartFile = path.join(
os.homedir(),
LINUX_AUTOSTART_DIR,
LINUX_AUTOSTART_FILE,
);
if (fs.existsSync(autostartFile)) {
linuxAutoStart(true);
}
}
},
};
};

0 comments on commit 9a0dffc

Please sign in to comment.