mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 09:44:21 +02:00
update canKick whenever we get new data, instead of just at first use.
This commit is contained in:
parent
d0cdd4d5c1
commit
07ab771c2b
1 changed files with 4 additions and 2 deletions
|
@ -40,6 +40,7 @@ Rectangle {
|
|||
property int rowHeight: 50;
|
||||
property var userData: [];
|
||||
property var myData: ({displayName: "", userName: ""}); // valid dummy until set
|
||||
property bool iAmAdmin: false;
|
||||
function findSessionIndex(sessionId) { // no findIndex in .qml
|
||||
for (var i = 0; i < userData.length; i++) {
|
||||
if (userData[i].sessionId === sessionId) {
|
||||
|
@ -53,6 +54,7 @@ Rectangle {
|
|||
case 'users':
|
||||
var data = message.params;
|
||||
var myIndex = findSessionIndex('');
|
||||
iAmAdmin = Users.canKick;
|
||||
myData = data[myIndex];
|
||||
data.splice(myIndex, 1);
|
||||
userData = data;
|
||||
|
@ -139,13 +141,13 @@ Rectangle {
|
|||
width: actionWidth
|
||||
}
|
||||
TableViewColumn {
|
||||
visible: Users.canKick;
|
||||
visible: iAmAdmin;
|
||||
role: "mute";
|
||||
title: "Mute";
|
||||
width: actionWidth
|
||||
}
|
||||
TableViewColumn {
|
||||
visible: Users.canKick;
|
||||
visible: iAmAdmin;
|
||||
role: "kick";
|
||||
title: "Ban"
|
||||
width: actionWidth
|
||||
|
|
Loading…
Reference in a new issue