mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +00:00
Fixes #1746
This commit is contained in:
parent
d882328398
commit
037fd43a4a
4 changed files with 8 additions and 5 deletions
|
|
@ -1261,4 +1261,5 @@
|
||||||
<string name="december">December</string>
|
<string name="december">December</string>
|
||||||
<string name="cds_subtitle">Adjust when your day switches over past the default time of midnight.</string>
|
<string name="cds_subtitle">Adjust when your day switches over past the default time of midnight.</string>
|
||||||
<string name="buy_set">Buy Set</string>
|
<string name="buy_set">Buy Set</string>
|
||||||
|
<string name="tutorial_reset_confirmation">Your Tutorials were reset</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ interface UserRepository : BaseRepository {
|
||||||
|
|
||||||
fun revive(): Flowable<User>
|
fun revive(): Flowable<User>
|
||||||
|
|
||||||
fun resetTutorial()
|
fun resetTutorial(): Maybe<User>
|
||||||
|
|
||||||
fun sleep(user: User): Flowable<User>
|
fun sleep(user: User): Flowable<User>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,8 @@ class UserRepositoryImpl(
|
||||||
}
|
}
|
||||||
.flatMap { retrieveUser(false, true) }
|
.flatMap { retrieveUser(false, true) }
|
||||||
|
|
||||||
override fun resetTutorial() {
|
override fun resetTutorial(): Maybe<User> {
|
||||||
localRepository.getTutorialSteps()
|
return localRepository.getTutorialSteps()
|
||||||
.firstElement()
|
.firstElement()
|
||||||
.map<Map<String, Any>> { tutorialSteps ->
|
.map<Map<String, Any>> { tutorialSteps ->
|
||||||
val updateData = HashMap<String, Any>()
|
val updateData = HashMap<String, Any>()
|
||||||
|
|
@ -119,7 +119,6 @@ class UserRepositoryImpl(
|
||||||
updateData
|
updateData
|
||||||
}
|
}
|
||||||
.flatMap { updateData -> updateUser(updateData).firstElement() }
|
.flatMap { updateData -> updateUser(updateData).firstElement() }
|
||||||
.subscribe({ }, RxErrorHandler.handleEmptyError())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun sleep(user: User): Flowable<User> {
|
override fun sleep(user: User): Flowable<User> {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.habitrpg.android.habitica.data.FAQRepository
|
||||||
import com.habitrpg.android.habitica.databinding.FragmentSupportMainBinding
|
import com.habitrpg.android.habitica.databinding.FragmentSupportMainBinding
|
||||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||||
import com.habitrpg.android.habitica.helpers.MainNavigationController
|
import com.habitrpg.android.habitica.helpers.MainNavigationController
|
||||||
|
import com.habitrpg.android.habitica.helpers.RxErrorHandler
|
||||||
import com.habitrpg.android.habitica.modules.AppModule
|
import com.habitrpg.android.habitica.modules.AppModule
|
||||||
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
@ -57,7 +58,9 @@ class SupportMainFragment : BaseMainFragment<FragmentSupportMainBinding>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
binding?.resetTutorialButton?.setOnClickListener {
|
binding?.resetTutorialButton?.setOnClickListener {
|
||||||
userRepository.resetTutorial()
|
userRepository.resetTutorial().subscribe( {
|
||||||
|
activity?.showSnackbar(null, getString(R.string.tutorial_reset_confirmation))
|
||||||
|
}, RxErrorHandler.handleEmptyError())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue