mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
wait until items loaded
This commit is contained in:
parent
4c42b953d0
commit
895218b978
1 changed files with 18 additions and 5 deletions
|
@ -657,8 +657,12 @@ struct ChatView: View {
|
||||||
}
|
}
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
if let index = model.items.lastIndex(where: { $0.hasUnread() }) {
|
if let index = model.items.lastIndex(where: { $0.hasUnread() }) {
|
||||||
// scroll to the top unread item
|
if !loadingMoreItems {
|
||||||
scrollModel.scrollToRow(row: index)
|
// scroll to the top unread item
|
||||||
|
scrollModel.scrollToRow(row: index)
|
||||||
|
} else {
|
||||||
|
AlertManager.shared.showAlertMsg(title: "Wait", message: "Wait until items loaded")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.contextMenu {
|
.contextMenu {
|
||||||
|
@ -679,17 +683,26 @@ struct ChatView: View {
|
||||||
.foregroundColor(theme.colors.primary)
|
.foregroundColor(theme.colors.primary)
|
||||||
}
|
}
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
scrollModel.scrollToBottom()
|
if !loadingMoreItems {
|
||||||
|
scrollModel.scrollToBottom()
|
||||||
|
} else {
|
||||||
|
AlertManager.shared.showAlertMsg(title: "Wait", message: "Wait until items loaded")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if !model.isNearBottom {
|
} else if !model.isNearBottom {
|
||||||
circleButton {
|
circleButton {
|
||||||
Image(systemName: "chevron.down")
|
Image(systemName: "chevron.down")
|
||||||
.foregroundColor(theme.colors.primary)
|
.foregroundColor(theme.colors.primary)
|
||||||
}
|
}
|
||||||
.onTapGesture { scrollModel.scrollToBottom() }
|
.onTapGesture {
|
||||||
|
if !loadingMoreItems {
|
||||||
|
scrollModel.scrollToBottom()
|
||||||
|
} else {
|
||||||
|
AlertManager.shared.showAlertMsg(title: "Wait", message: "Wait until items loaded")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.disabled(loadingMoreItems)
|
|
||||||
.padding()
|
.padding()
|
||||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue