Fix room forget and buttons bugs
This commit is contained in:
parent
5988eccdbb
commit
c7dd602687
|
@ -93,8 +93,6 @@ class Backend(QObject):
|
|||
room_id, self.past_tokens[room_id], limit
|
||||
)
|
||||
break
|
||||
else:
|
||||
raise ValueError(f"Room not found in any client: {room_id}")
|
||||
|
||||
|
||||
@pyqtSlot()
|
||||
|
|
|
@ -23,6 +23,11 @@ class ListModelMap(QObject):
|
|||
return self.dict[key]
|
||||
|
||||
|
||||
@pyqtSlot(str, result=bool)
|
||||
def has(self, key) -> bool:
|
||||
return key in self.dict
|
||||
|
||||
|
||||
def __getitem__(self, key) -> ListModel:
|
||||
return self.dict[key]
|
||||
|
||||
|
|
|
@ -194,6 +194,10 @@ class SignalManager(QObject):
|
|||
.fromMSecsSinceEpoch(edict["server_timestamp"])
|
||||
new_event = RoomEvent(type=etype, dateTime=date_time, dict=edict)
|
||||
|
||||
if etype == "RoomCreateEvent":
|
||||
print(room_id, "ff")
|
||||
self.backend.fully_loaded_rooms.add(room_id)
|
||||
|
||||
if self._events_in_transfer:
|
||||
local_echoes_met: int = 0
|
||||
update_at: Optional[int] = None
|
||||
|
|
|
@ -60,6 +60,7 @@ Button {
|
|||
}
|
||||
|
||||
MouseArea {
|
||||
z: 101
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
|
|
|
@ -81,27 +81,34 @@ Rectangle {
|
|||
iconName: modelData.iconName
|
||||
display: bannerButtons.displayMode
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
propagateComposedEvents: true
|
||||
onClicked: {
|
||||
if (alreadyClicked) { return }
|
||||
|
||||
iconName = "hourglass"
|
||||
alreadyClicked = true
|
||||
|
||||
// modelData might become undefined after Backend call
|
||||
// modelData might be undefined after Backend call
|
||||
var signalId = modelData.signalId
|
||||
var iconName_ = modelData.iconName
|
||||
var isForget =
|
||||
modelData.clientFunction === "forgetRoom"
|
||||
|
||||
var future =
|
||||
Backend.clientManager.clients[chatPage.userId].
|
||||
call(modelData.clientFunction,
|
||||
modelData.clientArgs)
|
||||
|
||||
if (! isForget) {
|
||||
future.onGotResult.connect(function() {
|
||||
iconName = iconName_
|
||||
iconName = modelData.iconName
|
||||
})
|
||||
}
|
||||
|
||||
if (signalId) { buttonClicked(signalId) }
|
||||
}
|
||||
}
|
||||
|
||||
Layout.maximumWidth: bannerButtons.compact ? height : -1
|
||||
Layout.fillHeight: true
|
||||
|
|
|
@ -111,6 +111,7 @@ Image {
|
|||
Base.HButton {
|
||||
text: qsTr("Login")
|
||||
Layout.fillWidth: true
|
||||
|
||||
}
|
||||
Base.HButton {
|
||||
text: qsTr("Forgot?")
|
||||
|
|
Loading…
Reference in New Issue
Block a user