Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
netdisc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rocosen
netdisc
Commits
1787f9ce
Commit
1787f9ce
authored
Dec 02, 2022
by
rocosen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6
parent
150468d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
main.ts
src/main/main.ts
+8
-8
preference.jsx
src/renderer/components/preference.jsx
+3
-2
No files found.
src/main/main.ts
View file @
1787f9ce
...
...
@@ -59,7 +59,9 @@ if (!gotTheLock) {
}
app
.
setLoginItemSettings
({
openAtLogin
:
storage
.
getItem
(
'Preferences'
)
?
JSON
.
parse
(
storage
.
getItem
(
'Preferences'
))[
'selfStart'
]
:
true
,
openAtLogin
:
storage
.
getItem
(
'Preferences'
)
?
JSON
.
parse
(
storage
.
getItem
(
'Preferences'
))[
'selfStart'
]
:
true
,
openAsHidden
:
false
,
path
:
process
.
execPath
,
args
:
[],
...
...
@@ -139,16 +141,14 @@ ipcMain.on('window-close', (event) => {
ipcMain
.
on
(
'openAtLogin-true'
,
()
=>
{
app
.
setLoginItemSettings
({
openAtLogin
:
true
})
openAtLogin
:
true
,
});
});
ipcMain
.
on
(
'openAtLogin-false'
,
()
=>
{
app
.
setLoginItemSettings
({
openAtLogin
:
false
})
app
.
setLoginItemSettings
({
openAtLogin
:
false
,
});
});
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
...
...
src/renderer/components/preference.jsx
View file @
1787f9ce
...
...
@@ -51,8 +51,9 @@ export default (props) => {
'Preferences'
,
JSON
.
stringify
({
selfStart
:
event
.
target
.
checked
})
);
event
.
target
.
checked
?
electron
.
ipcRenderer
.
send
(
'openAtLogin-true'
):
electron
.
ipcRenderer
.
send
(
'openAtLogin-false'
);
event
.
target
.
checked
?
electron
.
ipcRenderer
.
send
(
'openAtLogin-true'
)
:
electron
.
ipcRenderer
.
send
(
'openAtLogin-false'
);
};
return
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment