Skip to content

Commit

Permalink
Merge pull request #29 from POE-Addon-Launcher/2.0.1
Browse files Browse the repository at this point in the history
v2.0.1 hotfix API key
  • Loading branch information
POE-Addon-Launcher authored Dec 25, 2018
2 parents 4359b18 + a821262 commit 0abfee9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>PAL-Launcher</groupId>
<artifactId>rewrite</artifactId>
<version>1.0-SNAPSHOT</version>
<version>2.0.1</version>

<properties>
<kotlin.version>1.3.0</kotlin.version>
Expand Down
14 changes: 13 additions & 1 deletion src/main/kotlin/Controller.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import javafx.scene.control.CheckBox
import javafx.scene.layout.AnchorPane
import org.kohsuke.github.GHAsset
import org.kohsuke.github.GHRelease
import org.kohsuke.github.GitHub
import java.net.URI
import java.nio.file.Files
import java.nio.file.Paths
Expand Down Expand Up @@ -214,7 +215,18 @@ class LaunchController: Initializable
}

GlobalScope.launch {
val gh = connect()
lateinit var gh: GitHub

gh = if (pcGithubToken.text != "")
{
connect(pcGithubToken.text)
}
else
{
connect()
}


if (canQuerry(gh))
{
lpStatusAdd("\n\nConnect Succesful\nYou have ${gh.rateLimit.remaining} requests left which reset at:\n${gh.rateLimit.resetDate}")
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/GithubHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ fun connect(): GitHub
return GitHub.connectAnonymously()
}

fun connect(arg: String): GitHub
{
return GitHub.connectUsingOAuth(arg)
}

fun checkReleases(github: GitHub): MutableList<GHRelease>?
{
val repo = github.getRepository(Constants.REPOSITORY)
Expand Down

0 comments on commit 0abfee9

Please sign in to comment.