Skip to content

Commit

Permalink
Just a test commit for investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
orchestr7 committed Sep 8, 2024
1 parent 7090812 commit bf62d7d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
1 change: 1 addition & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.liquibase:liquibase-core")
implementation("com.h2database:h2:2.3.232")
implementation("com.mysql:mysql-connector-j:9.0.0")
implementation("commons-codec:commons-codec:1.17.1")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ val questionCard = FC<QuestionCard> { props ->
val pokemon = Resources.getById(props.pokemonId)

val updateResult = useDeferredRequest {
console.log("Test")
if (props.tgUser != null) {
val response = get(
url = "${window.location.origin}/api/update",
Expand Down Expand Up @@ -91,7 +90,6 @@ val questionCard = FC<QuestionCard> { props ->
if (pokemon.type == BIG_DATA) {
updateResult()
props.answers[props.counter] = CORRECT
console.log("a")
} else {
props.answers[props.counter] = WRONG
}
Expand All @@ -114,15 +112,10 @@ val questionCard = FC<QuestionCard> { props ->
props.setSelection(ANSWER)
props.setCounter(props.counter + 1)
if (pokemon.type == POKEMON) {
console.log("Entering POKEMON condition")
updateResult()
props.answers[props.counter] = CORRECT
console.log("Answer set to CORRECT")
console.log("tgUser: ${props.tgUser}")
} else {
console.log("POKEMON condition not met")
props.answers[props.counter] = WRONG
console.log("Answer set to WRONG")
}
props.setAnswers(props.answers)
}
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/jsMain/kotlin/ru/posidata/views/main/Welcome.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
)

when {
response.ok -> props.setUser(response.decodeFromJsonString<UserForSerializationDTO>())
response.ok -> {
props.setUser(response.decodeFromJsonString<UserForSerializationDTO>())
}
else -> window.alert("Failed to login with telegram")
}
}
props.setSelection(Selection.QUESTION)
}

// just a small test
/*div {
div {
button {
onClick = {
console.log(props.tgUser)
Expand All @@ -68,7 +71,7 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
}
}
}
*/


div {
className = ClassName("row justify-content-center mt-1 px-0")
Expand Down Expand Up @@ -142,7 +145,7 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
requestAccess = "write"
usePic = null
lang = null
additionalClassNames = "d-flex justify-content-center zIndex1000"
additionalClassNames = "d-flex justify-content-center zIndex1000 mb-2"
onAuthCallback = { user ->
val feUser = UserDataFromTelegram(
authDate = user.auth_date,
Expand Down Expand Up @@ -178,7 +181,6 @@ val welcomeCard = FC<WelcomeCardProps> { props ->
}
onClick = {
getUser()
props.setSelection(Selection.QUESTION)
}
}
}
Expand Down

0 comments on commit bf62d7d

Please sign in to comment.