diff --git a/LogWatcher.cs b/LogWatcher.cs index de8158dd..3498fe86 100644 --- a/LogWatcher.cs +++ b/LogWatcher.cs @@ -94,9 +94,8 @@ namespace VRCX { Thread.Sleep(1000); } - catch + catch(ThreadInterruptedException) { - // ThreadInterruptedException } } } diff --git a/MainForm.cs b/MainForm.cs index 547117dc..a656852d 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -103,7 +103,15 @@ namespace VRCX { state = FormWindowState.Minimized; } - WindowState = state; + if ("true".Equals(VRCXStorage.Instance.Get("VRCX_StartAsMinimizedState")) && + "true".Equals(VRCXStorage.Instance.Get("VRCX_CloseToTray"))) + { + BeginInvoke(new MethodInvoker(Hide)); + } + else + { + WindowState = state; + } } catch { @@ -136,7 +144,7 @@ namespace VRCX private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing && - "true".Equals(SharedVariable.Instance.Get("config:vrcx_closetotray"))) + "true".Equals(VRCXStorage.Instance.Get("VRCX_CloseToTray"))) { e.Cancel = true; Hide(); diff --git a/VRCXVR.cs b/VRCXVR.cs index 4c2c7ecf..5cfbcc1b 100644 --- a/VRCXVR.cs +++ b/VRCXVR.cs @@ -148,9 +148,8 @@ namespace VRCX { Thread.Sleep(32); } - catch + catch(ThreadInterruptedException) { - // ThreadInterruptedException } if (_active) diff --git a/html/src/app.js b/html/src/app.js index 244444ff..31d65168 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -12335,7 +12335,13 @@ speechSynthesis.getVoices(); ); $app.data.isStartAsMinimizedState = VRCXStorage.Get('VRCX_StartAsMinimizedState') === 'true'; - $app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray'); + $app.data.isCloseToTray = VRCXStorage.Get('VRCX_CloseToTray') === 'true'; + if (configRepository.getBool('VRCX_CloseToTray')) { + // move back to JSON + $app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray'); + VRCXStorage.Set('VRCX_CloseToTray', $app.data.isCloseToTray.toString()); + configRepository.remove('VRCX_CloseToTray'); + } var saveVRCXWindowOption = function () { configRepository.setBool( 'VRCX_StartAtWindowsStartup', @@ -12345,7 +12351,7 @@ speechSynthesis.getVoices(); 'VRCX_StartAsMinimizedState', this.isStartAsMinimizedState.toString() ); - configRepository.setBool('VRCX_CloseToTray', this.isCloseToTray); + VRCXStorage.Set('VRCX_CloseToTray', this.isCloseToTray.toString()); AppApi.SetStartup(this.isStartAtWindowsStartup); }; $app.watch.isStartAtWindowsStartup = saveVRCXWindowOption;