Skip to content

Commit b5ef9a9

Browse files
committed
fix templates questExtra
1 parent 7d47d65 commit b5ef9a9

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

app/src/main/java/neth/iecal/questphone/data/TemplatesData.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,21 @@ data class AllQuestsWrapper(
9595
val HealthConnect: HealthQuest = HealthQuest(),
9696
) {
9797
fun getQuestJson(type: IntegrationId):String{
98-
when(type){
98+
return when(type){
9999
IntegrationId.DEEP_FOCUS -> {
100-
json.encodeToString<DeepFocus>(DeepFocus)
100+
json.encodeToString<DeepFocus>(this.DeepFocus)
101101
}
102+
102103
IntegrationId.HEALTH_CONNECT -> {
103-
json.encodeToString<HealthQuest>(HealthConnect)
104+
json.encodeToString<HealthQuest>(this.HealthConnect)
104105
}
106+
105107
IntegrationId.SWIFT_MARK -> {
106108
"{}"
107109
}
110+
108111
IntegrationId.AI_SNAP -> {
109-
json.encodeToString<AiSnap>(AiSnap)
112+
json.encodeToString<AiSnap>(this.AiSnap)
110113
}
111114
}
112115
return "{}"

app/src/main/java/neth/iecal/questphone/ui/screens/quest/templates/SetupTemplate.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ fun SetupTemplate(id: String,controller: NavController) {
312312
it.questExtraVariableDeclaration.forEach {
313313
templateExtra = it.setter(templateExtra,variableValues,it.name)
314314
}
315-
it.basicQuest.quest_json = it.questExtra.getQuestJson(it.basicQuest.integration_id)
315+
Log.d("FInal data",templateExtra.toString())
316+
it.basicQuest.quest_json = templateExtra.getQuestJson(it.basicQuest.integration_id)
316317
Log.d("Final Data",it.basicQuest.toString())
317318
scope.launch {
318319
val questDao = QuestDatabaseProvider.getInstance(context).questDao()

0 commit comments

Comments
 (0)