Fixed DeepL state after changing its settings
This commit is contained in:
parent
96823aa948
commit
882c2bba2b
@ -168,7 +168,11 @@ public static class AppSettings
|
||||
|
||||
#region DeepL Mode
|
||||
|
||||
public static async Task SetDeepLMode(SettingDeepLMode mode) => await AppSettings.SetSetting(SettingNames.DEEPL_MODE, mode);
|
||||
public static async Task SetDeepLMode(SettingDeepLMode mode)
|
||||
{
|
||||
DeepL.ResetState();
|
||||
await AppSettings.SetSetting(SettingNames.DEEPL_MODE, mode);
|
||||
}
|
||||
|
||||
public static async Task<SettingDeepLMode> GetDeepLMode() => await AppSettings.GetSetting(SettingNames.DEEPL_MODE, SettingDeepLMode.DISABLED);
|
||||
|
||||
@ -176,7 +180,11 @@ public static class AppSettings
|
||||
|
||||
#region DeepL API Key
|
||||
|
||||
public static async Task SetDeepLAPIKey(string apiKey) => await AppSettings.SetSetting(SettingNames.DEEPL_API_KEY, apiKey);
|
||||
public static async Task SetDeepLAPIKey(string apiKey)
|
||||
{
|
||||
DeepL.ResetState();
|
||||
await AppSettings.SetSetting(SettingNames.DEEPL_API_KEY, apiKey);
|
||||
}
|
||||
|
||||
public static async Task<string> GetDeepLAPIKey() => await AppSettings.GetSetting(SettingNames.DEEPL_API_KEY, string.Empty);
|
||||
|
||||
|
@ -76,4 +76,6 @@ public static class DeepL
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ResetState() => DEEPL_NOT_AVAILABLE = false;
|
||||
}
|
@ -2,5 +2,5 @@
|
||||
|
||||
public static class Version
|
||||
{
|
||||
public static string Text => $"v0.8.3 (2023-02-11), .NET {Environment.Version}";
|
||||
public static string Text => $"v0.8.4 (2023-02-12), .NET {Environment.Version}";
|
||||
}
|
@ -79,6 +79,7 @@ internal static class Program
|
||||
// Start the app:
|
||||
do
|
||||
{
|
||||
Processor.DeepL.ResetState();
|
||||
Application.Run(new Main());
|
||||
} while (Program.RestartMainApp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user