bugfix
This commit is contained in:
parent
ed474409e8
commit
ba124a4aa5
@ -31,7 +31,6 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentProfileBinding.bind(view)
|
_binding = FragmentProfileBinding.bind(view)
|
||||||
checkForAdmin()
|
|
||||||
|
|
||||||
binding.swipeRefresh.setOnRefreshListener {
|
binding.swipeRefresh.setOnRefreshListener {
|
||||||
if (getIsMe()) refreshData() else showData(getUserDto()!!);
|
if (getIsMe()) refreshData() else showData(getUserDto()!!);
|
||||||
@ -52,12 +51,13 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
|
|||||||
binding.recyclerViewLogs.adapter = adapter
|
binding.recyclerViewLogs.adapter = adapter
|
||||||
|
|
||||||
if (getIsMe()) {
|
if (getIsMe()) {
|
||||||
|
checkForAdmin()
|
||||||
refreshData()
|
refreshData()
|
||||||
viewModel.visitListState.collectWithLifecycle(this) { data -> adapter.submitData(data) }
|
viewModel.visitListState.collectWithLifecycle(this) { data -> adapter.submitData(data) }
|
||||||
waitForQRScanResult()
|
waitForQRScanResult()
|
||||||
} else {
|
} else {
|
||||||
showData(getUserDto()!!)
|
showData(getUserDto()!!)
|
||||||
|
checkForAdmin()
|
||||||
Log.d("ProfileFragment", "set login")
|
Log.d("ProfileFragment", "set login")
|
||||||
viewModel.visitListStateFromLogin.collectWithLifecycle(this) { data ->
|
viewModel.visitListStateFromLogin.collectWithLifecycle(this) { data ->
|
||||||
adapter.submitData(data)
|
adapter.submitData(data)
|
||||||
@ -75,7 +75,7 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
|
|||||||
if (userDTO.roles.any { it.name == "ROLE_ADMIN" }) {
|
if (userDTO.roles.any { it.name == "ROLE_ADMIN" }) {
|
||||||
binding.buttonSearch.visibility = View.VISIBLE
|
binding.buttonSearch.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
binding.rightsUsingSmartphone.text = if (userDTO.isACSBlocked) "Пропуск действителен" else "Пропуск действителен"
|
binding.rightsUsingSmartphone.text = if (userDTO.isACSBlocked) "Пропуск недействителен" else "Пропуск действителен"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideButtons() {
|
private fun hideButtons() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user