mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-31 17:43:04 -06:00
Rename IsAutoUpdateDisabled to IsAutoUpdateAllowed and env var to DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/aa3944a4-e542-4770-8d17-2acb2c958ce9
This commit is contained in:
parent
c61c9bef55
commit
2a291b0dff
|
|
@ -10,7 +10,7 @@ namespace DiscordChatExporter.Gui.Services;
|
|||
public class UpdateService(SettingsService settingsService) : IDisposable
|
||||
{
|
||||
private readonly IUpdateManager? _updateManager =
|
||||
OperatingSystem.IsWindows() && !StartOptions.Current.IsAutoUpdateDisabled
|
||||
OperatingSystem.IsWindows() && StartOptions.Current.IsAutoUpdateAllowed
|
||||
? new UpdateManager(
|
||||
new GithubPackageResolver(
|
||||
"Tyrrrz",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public partial class StartOptions
|
|||
{
|
||||
public required string SettingsPath { get; init; }
|
||||
|
||||
public required bool IsAutoUpdateDisabled { get; init; }
|
||||
public required bool IsAutoUpdateAllowed { get; init; }
|
||||
}
|
||||
|
||||
public partial class StartOptions
|
||||
|
|
@ -22,8 +22,9 @@ public partial class StartOptions
|
|||
? Path.Combine(path, "Settings.dat")
|
||||
: path
|
||||
: Path.Combine(AppContext.BaseDirectory, "Settings.dat"),
|
||||
IsAutoUpdateDisabled =
|
||||
Environment.GetEnvironmentVariable("DISCORDCHATEXPORTER_DISABLE_UPDATE") is { } v
|
||||
&& (v == "1" || v.Equals("true", StringComparison.OrdinalIgnoreCase)),
|
||||
IsAutoUpdateAllowed =
|
||||
Environment.GetEnvironmentVariable("DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE") is not
|
||||
{ } v
|
||||
|| !(v == "0" || v.Equals("false", StringComparison.OrdinalIgnoreCase)),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class SettingsViewModel : DialogViewModelBase
|
|||
}
|
||||
|
||||
public bool IsAutoUpdateAvailable { get; } =
|
||||
OperatingSystem.IsWindows() && !StartOptions.Current.IsAutoUpdateDisabled;
|
||||
OperatingSystem.IsWindows() && StartOptions.Current.IsAutoUpdateAllowed;
|
||||
|
||||
public bool IsAutoUpdateEnabled
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue