File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232
3333 // Serialize saves so rapid toggles don't race each other
3434 let saveChain = Promise .resolve ();
35+ let autoStartChain = Promise .resolve ();
3536
3637 onMount (() => {
3738 void loadSettings ();
105106 function toggleLaunchAtLogin() {
106107 const enabled = ! launchAtLoginEnabled ;
107108 launchAtLoginEnabled = enabled ;
108- void invoke (" set_autostart_cmd" , { enabled }).catch ((e : unknown ) => {
109- console .error (" [settings] Failed to set autostart setting:" , e );
110- launchAtLoginEnabled = ! enabled ;
111- });
109+ autoStartChain = autoStartChain
110+ .then (async () => { await invoke (" set_autostart_cmd" , { enabled }); })
111+ .catch ((e : unknown ) => {
112+ console .error (" [settings] Failed to set autostart setting:" , e );
113+ launchAtLoginEnabled = ! enabled ;
114+ });
112115 }
113116
114117 function toggleRepo(repo : string ) {
You can’t perform that action at this time.
0 commit comments