+2
-2
src-tauri/src/main.rs
+2
-2
src-tauri/src/main.rs
···
156
156
WindowEvent::CloseRequested { api, .. } => {
157
157
let config: State<Config> = window.state();
158
158
159
-
let val = get_config_value_string("minimise-on-close".into(), config.clone());
160
-
if val.is_some() && val.unwrap() == "false"{
159
+
let val = get_config_value_string("close-to-tray".into(), config.clone());
160
+
if val.is_none() || val.unwrap() != "true"{
161
161
config.save();
162
162
return;
163
163
}
+5
-5
src/Components/SettingsMenu.tsx
+5
-5
src/Components/SettingsMenu.tsx
···
221
221
</div>
222
222
223
223
<div class="selector">
224
-
<input type="checkbox" id="minimise-on-close-check" ref={async ( el ) => {
225
-
el.checked = await invoke('get_config_value_string', { key: 'minimise-on-close' }) === "false" ? false : true;
224
+
<input type="checkbox" id="close-to-tray-check" ref={async ( el ) => {
225
+
el.checked = await invoke('get_config_value_string', { key: 'close-to-tray' }) === "true" ? true : false;
226
226
}} onChange={( el ) => {
227
227
if(el.target.checked){
228
-
invoke('set_config_value_string', { key: 'minimise-on-close', value: 'true' });
228
+
invoke('set_config_value_string', { key: 'close-to-tray', value: 'true' });
229
229
} else{
230
-
invoke('set_config_value_string', { key: 'minimise-on-close', value: 'false' });
230
+
invoke('set_config_value_string', { key: 'close-to-tray', value: 'false' });
231
231
}
232
232
}} />
233
233
Close to tray
234
234
235
-
<label for="minimise-on-close-check">
235
+
<label for="close-to-tray-check">
236
236
<div class="selection-box">
237
237
<div class="icon-small" style={{ margin: '0', display: 'inline-flex' }}>
238
238
<img draggable="false" width="10" height="10" src="/icon/check-solid.svg"></img>