mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 04:21:44 +00:00
fix: show disconnected/connected banner on load
This commit is contained in:
parent
83d2e274ff
commit
b3fcd394de
@ -17,7 +17,7 @@ proc peerSummaryChange*(self: NetworkModel, peers: seq[string]) =
|
||||
if peers.len == 0:
|
||||
self.events.emit("chat:disconnected", Args())
|
||||
|
||||
if peers.len > 0 and self.peers.len == 0:
|
||||
if peers.len > 0:
|
||||
self.events.emit("chat:connected", Args())
|
||||
|
||||
self.peers = peers
|
||||
|
@ -63,6 +63,7 @@ StackLayout {
|
||||
z: 60
|
||||
Rectangle {
|
||||
Component.onCompleted: {
|
||||
isConnected = chatsModel.isOnline
|
||||
if(!isConnected){
|
||||
connectedStatusRect.visible = true
|
||||
}
|
||||
@ -91,8 +92,9 @@ StackLayout {
|
||||
Connections {
|
||||
target: chatsModel
|
||||
onOnlineStatusChanged: {
|
||||
isConnected = connected
|
||||
if(connected){
|
||||
if (connected == isConnected) return;
|
||||
isConnected = connected;
|
||||
if(isConnected){
|
||||
timer.setTimeout(function(){
|
||||
connectedStatusRect.visible = false;
|
||||
}, 5000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user