forked from github/szkolny
[Lab] Fix full sync buttons.
This commit is contained in:
parent
9535f53563
commit
158b69a8d3
@ -62,6 +62,7 @@ class LabPageFragment : LazyFragment(), CoroutineScope {
|
||||
b.last10unseen.isVisible = false
|
||||
b.fullSync.isVisible = false
|
||||
b.clearProfile.isVisible = false
|
||||
b.clearEndpointTimers.isVisible = false
|
||||
b.rodo.isVisible = false
|
||||
b.removeHomework.isVisible = false
|
||||
b.unarchive.isVisible = false
|
||||
@ -83,14 +84,18 @@ class LabPageFragment : LazyFragment(), CoroutineScope {
|
||||
}
|
||||
|
||||
b.fullSync.onClick {
|
||||
app.db.query(SimpleSQLiteQuery("UPDATE profiles SET empty = 1 WHERE profileId = ${App.profileId}"))
|
||||
app.db.query(SimpleSQLiteQuery("DELETE FROM endpointTimers WHERE profileId = ${App.profileId}"))
|
||||
app.profile.empty = true
|
||||
app.profileSave()
|
||||
}
|
||||
|
||||
b.clearProfile.onClick {
|
||||
ProfileRemoveDialog(activity, App.profileId, "FAKE", noProfileRemoval = true).show()
|
||||
}
|
||||
|
||||
b.clearEndpointTimers.onClick {
|
||||
app.db.endpointTimerDao().clear(app.profileId)
|
||||
}
|
||||
|
||||
b.removeHomework.onClick {
|
||||
app.db.eventDao().getRawNow("UPDATE events SET homeworkBody = NULL WHERE profileId = ${App.profileId}")
|
||||
}
|
||||
|
@ -75,10 +75,17 @@
|
||||
android:id="@+id/clearProfile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="Clear all profile data"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/clearEndpointTimers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="Clear endpoint timers (force full sync)"
|
||||
android:textAllCaps="false" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/rodo"
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user