Skip to content

Commit 0abfee9

Browse files
Merge pull request #29 from POE-Addon-Launcher/2.0.1
v2.0.1 hotfix API key
2 parents 4359b18 + a821262 commit 0abfee9

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>PAL-Launcher</groupId>
88
<artifactId>rewrite</artifactId>
9-
<version>1.0-SNAPSHOT</version>
9+
<version>2.0.1</version>
1010

1111
<properties>
1212
<kotlin.version>1.3.0</kotlin.version>

src/main/kotlin/Controller.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import javafx.scene.control.CheckBox
2424
import javafx.scene.layout.AnchorPane
2525
import org.kohsuke.github.GHAsset
2626
import org.kohsuke.github.GHRelease
27+
import org.kohsuke.github.GitHub
2728
import java.net.URI
2829
import java.nio.file.Files
2930
import java.nio.file.Paths
@@ -214,7 +215,18 @@ class LaunchController: Initializable
214215
}
215216

216217
GlobalScope.launch {
217-
val gh = connect()
218+
lateinit var gh: GitHub
219+
220+
gh = if (pcGithubToken.text != "")
221+
{
222+
connect(pcGithubToken.text)
223+
}
224+
else
225+
{
226+
connect()
227+
}
228+
229+
218230
if (canQuerry(gh))
219231
{
220232
lpStatusAdd("\n\nConnect Succesful\nYou have ${gh.rateLimit.remaining} requests left which reset at:\n${gh.rateLimit.resetDate}")

src/main/kotlin/GithubHandler.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ fun connect(): GitHub
2929
return GitHub.connectAnonymously()
3030
}
3131

32+
fun connect(arg: String): GitHub
33+
{
34+
return GitHub.connectUsingOAuth(arg)
35+
}
36+
3237
fun checkReleases(github: GitHub): MutableList<GHRelease>?
3338
{
3439
val repo = github.getRepository(Constants.REPOSITORY)

0 commit comments

Comments
 (0)