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

Commit

Permalink
fix auto updater not working with pre-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsEmpa committed Oct 3, 2024
1 parent 5f93621 commit 5b175b0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/main/kotlin/com/ratons/config/features/About.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.ratons.config.features;

import at.hannibal2.skyhanni.deps.moulconfig.annotations.ConfigEditorBoolean;
import at.hannibal2.skyhanni.deps.moulconfig.annotations.ConfigEditorDropdown;
import at.hannibal2.skyhanni.deps.moulconfig.annotations.ConfigOption;
import com.google.gson.annotations.Expose;
import com.ratons.features.misc.update.UpdateStream;

public class About {

Expand All @@ -11,6 +13,11 @@ public class About {
@ConfigEditorBoolean
public boolean autoUpdates = true;

@Expose
@ConfigOption(name = "Update Stream", desc = "Select the update stream.")
@ConfigEditorDropdown
public UpdateStream updateStream = UpdateStream.FULL;

@Expose
@ConfigOption(name = "Debug", desc = "Developer setting for checking debug messages.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ object UpdateManager {
checkUpdate()
}

fun checkUpdate() {
activePromise = context.checkUpdate("full")
fun checkUpdate(stream: String = config.updateStream.streamName) {
activePromise = context.checkUpdate(stream)
.thenAcceptAsync({
potentialUpdate = it
if (it.isUpdateAvailable) {
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/com/ratons/features/misc/update/UpdateStream.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.ratons.features.misc.update

@Suppress("unused")
enum class UpdateStream(private val displayName: String, val streamName: String = "") {
NONE("None"),
PRERELEASE("Pre-release", "pre"),
FULL("Full", "full"),
;

override fun toString() = displayName
}

0 comments on commit 5b175b0

Please sign in to comment.