Enable lazy loading by default.

Also fixes undefined error when not logged in.
This commit is contained in:
Black Hat
2018-08-19 20:45:40 +08:00
parent cfe34e5303
commit 4d97fe6901
9 changed files with 24 additions and 19 deletions

View File

@@ -6,15 +6,13 @@ import Matrique 0.1
import "qrc:/qml/form"
Page {
property var connection
property alias connection: roomListModel.connection
id: page
RoomListModel {
id: roomListModel
connection: page.connection
onRoomAdded: setting.lazyLoad ? {} : room.getPreviousContent(20)
onNewMessage: window.active ? {} : matriqueController.showMessage(roomName, content, icon)
}

View File

@@ -240,6 +240,4 @@ Item {
}
}
}
onCurrentRoomChanged: setting.lazyLoad && currentRoom && !currentRoom.timelineSize ? currentRoom.getPreviousContent(20) : {}
}

View File

@@ -10,6 +10,7 @@ Page {
Switch {
id: lazyLoadSwitch
text: "Lazy load at initial sync"
checked: true
}
Switch {
id: asyncMessageDelegateSwitch

View File

@@ -73,7 +73,7 @@ ApplicationWindow {
parent: null
connection: matriqueController.isLogin ? window.connection : undefined
connection: matriqueController.isLogin ? window.connection : null
}
Setting {