diff --git a/AstroWall/BusinessLayer/ApplicationHandler.cs b/AstroWall/BusinessLayer/ApplicationHandler.cs index c6c8634..9a4efec 100644 --- a/AstroWall/BusinessLayer/ApplicationHandler.cs +++ b/AstroWall/BusinessLayer/ApplicationHandler.cs @@ -108,6 +108,9 @@ private bool primaryInitAndCheckIfPrefsAreAvail() // Create status bar icon / menu MenuHandler.createStatusBar("Astrowall v" + Updates.currentVersion); + // Init state + State = new State(this, currentVersionStringWithCommit); + // Load prefs. If non-present halt further actions until // preft are confirmed by user Prefs = Preferences.Preferences.fromSave(); @@ -117,8 +120,6 @@ private bool primaryInitAndCheckIfPrefsAreAvail() private async Task secondaryInit(Preferences.Preferences prefsFromPostInstallPrompt) { - // Init state - State = new State(this, currentVersionStringWithCommit); // Check for updates. if (!IncorrectInstallPath) diff --git a/AstroWall/BusinessLayer/Logging.cs b/AstroWall/BusinessLayer/Logging.cs index bc44da4..2ad480a 100644 --- a/AstroWall/BusinessLayer/Logging.cs +++ b/AstroWall/BusinessLayer/Logging.cs @@ -55,8 +55,11 @@ public static Action GetLogger(string caller, bool isError = false) private void pruneLogFile() { string path = General.getLogPath(); + if (File.Exists(path)) + { long size = (new FileInfo(path)).Length; if (size > 5000000) File.Delete(path); + } } } }