Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit c3b2ff7

Browse files
committed
Just store one version to skip, that's enough
1 parent 9fdb252 commit c3b2ff7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UpdateCheck.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ public static void CheckForUpdates()
7171
TheVersion current = TheVersion.Parse(ApplicationInfo.Version);
7272
TheVersion newVersion = package.Version;
7373

74-
TheVersion[] versionsToSkip = EntryPoint.ApplicationManager.UserSettings.Get<TheVersion[]>(Constants.SkipVersionKey);
75-
versionsToSkip = versionsToSkip == null ? new TheVersion[] {} : versionsToSkip;
76-
if (versionsToSkip.Any(x => x == newVersion))
74+
var versionToSkip = EntryPoint.ApplicationManager.UserSettings.Get<TheVersion>(Constants.SkipVersionKey);
75+
if (versionToSkip == newVersion)
7776
{
7877
LogHelper.Info("Skipping GitHub for Unity update v" + newVersion);
7978
return;
@@ -192,8 +191,7 @@ private void OnGUI()
192191
if (GUILayout.Button(guiSkipThisVersion, GUILayout.Width(200)))
193192
{
194193
var settings = EntryPoint.ApplicationManager.UserSettings;
195-
var skipVersions = settings.Get<TheVersion[]>(Constants.SkipVersionKey).Append(package.Package.Version);
196-
settings.Set<TheVersion[]>(Constants.SkipVersionKey, skipVersions);
194+
settings.Set<TheVersion>(Constants.SkipVersionKey, package.Package.Version);
197195
this.Close();
198196
}
199197

0 commit comments

Comments
 (0)