[UI] Fix displaying lists for correct profile in event manual dialog.

This commit is contained in:
Kuba Szczodrzyński 2020-03-19 20:09:35 +01:00
parent 0296c704cb
commit 3957453ed6
5 changed files with 11 additions and 11 deletions

View File

@ -174,7 +174,7 @@ class EventManualDialog(
enqueuedWeekStart = weekStart enqueuedWeekStart = weekStart
EdziennikTask.syncProfile( EdziennikTask.syncProfile(
profileId = App.profileId, profileId = profileId,
viewIds = listOf( viewIds = listOf(
MainActivity.DRAWER_ITEM_TIMETABLE to 0 MainActivity.DRAWER_ITEM_TIMETABLE to 0
), ),
@ -210,7 +210,7 @@ class EventManualDialog(
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
fun onApiTaskFinishedEvent(event: ApiTaskFinishedEvent) { fun onApiTaskFinishedEvent(event: ApiTaskFinishedEvent) {
if (event.profileId == App.profileId) { if (event.profileId == profileId) {
enqueuedWeekDialog?.dismiss() enqueuedWeekDialog?.dismiss()
enqueuedWeekDialog = null enqueuedWeekDialog = null
progressDialog?.dismiss() progressDialog?.dismiss()
@ -241,7 +241,7 @@ class EventManualDialog(
with (b.dateDropdown) { with (b.dateDropdown) {
db = app.db db = app.db
profileId = App.profileId profileId = profileId
showWeekDays = false showWeekDays = false
showDays = true showDays = true
showOtherDate = true showOtherDate = true
@ -269,7 +269,7 @@ class EventManualDialog(
with (b.timeDropdown) { with (b.timeDropdown) {
db = app.db db = app.db
profileId = App.profileId profileId = profileId
showAllDay = true showAllDay = true
showCustomTime = true showCustomTime = true
lessonsDate = b.dateDropdown.getSelected() as? Date ?: Date.getToday() lessonsDate = b.dateDropdown.getSelected() as? Date ?: Date.getToday()
@ -289,7 +289,7 @@ class EventManualDialog(
with (b.teamDropdown) { with (b.teamDropdown) {
db = app.db db = app.db
profileId = App.profileId profileId = profileId
showNoTeam = true showNoTeam = true
loadItems() loadItems()
selectTeamClass() selectTeamClass()
@ -299,7 +299,7 @@ class EventManualDialog(
with (b.subjectDropdown) { with (b.subjectDropdown) {
db = app.db db = app.db
profileId = App.profileId profileId = profileId
showNoSubject = true showNoSubject = true
showCustomSubject = false showCustomSubject = false
loadItems() loadItems()
@ -309,7 +309,7 @@ class EventManualDialog(
with (b.teacherDropdown) { with (b.teacherDropdown) {
db = app.db db = app.db
profileId = App.profileId profileId = profileId
showNoTeacher = true showNoTeacher = true
loadItems() loadItems()
selectDefault(editingEvent?.teacherId) selectDefault(editingEvent?.teacherId)

View File

@ -73,7 +73,7 @@ class HomeDebugCard(
} }
b.syncReceivers.onClick { b.syncReceivers.onClick {
EdziennikTask.recipientListGet(App.profileId).enqueue(activity) EdziennikTask.recipientListGet(profile.id).enqueue(activity)
} }

View File

@ -77,7 +77,7 @@ class HomeEventsCard(
} }
) )
app.db.eventDao().getAllNearest(App.profileId, Date.getToday(), 4).observe(activity, Observer { events -> app.db.eventDao().getAllNearest(profile.id, Date.getToday(), 4).observe(activity, Observer { events ->
adapter.items = events adapter.items = events
if (b.eventsView.adapter == null) { if (b.eventsView.adapter == null) {
b.eventsView.adapter = adapter b.eventsView.adapter = adapter

View File

@ -60,7 +60,7 @@ class HomeLuckyNumberCard(
R.string.home_lucky_number_details R.string.home_lucky_number_details
b.subText.setText(subTextRes, profile.name ?: "", profile.studentNumber) b.subText.setText(subTextRes, profile.name ?: "", profile.studentNumber)
app.db.luckyNumberDao().getNearestFuture(App.profileId, todayValue).observe(fragment, Observer { luckyNumber -> app.db.luckyNumberDao().getNearestFuture(profile.id, todayValue).observe(fragment, Observer { luckyNumber ->
val isYours = luckyNumber?.number == profile.studentNumber val isYours = luckyNumber?.number == profile.studentNumber
val res: Pair<Int, Array<out Any>> = when { val res: Pair<Int, Array<out Any>> = when {
luckyNumber == null -> R.string.home_lucky_number_no_info to emptyArray() luckyNumber == null -> R.string.home_lucky_number_no_info to emptyArray()

View File

@ -192,7 +192,7 @@ class HomeTimetableCard(
b.noTimetableSync.onClick { b.noTimetableSync.onClick {
it.isEnabled = false it.isEnabled = false
EdziennikTask.syncProfile( EdziennikTask.syncProfile(
profileId = App.profileId, profileId = profile.id,
viewIds = listOf( viewIds = listOf(
MainActivity.DRAWER_ITEM_TIMETABLE to 0 MainActivity.DRAWER_ITEM_TIMETABLE to 0
), ),