Skip to content

Commit

Permalink
Fixed member online status
Browse files Browse the repository at this point in the history
ScrollArea has been depricated, changed to ScrollView
  • Loading branch information
mkelley88 committed Feb 25, 2024
1 parent d69afa3 commit 39c5410
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import QtQuick.Controls 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.extras 2.0 as PlasmaExtras

Item {
Expand Down Expand Up @@ -81,6 +82,15 @@ Item {
console.log("NETWORK ONLINE COUNT:",onlinecount)
zeroRequest("network/"+netw+"/member", function(res) {
for (let dat of res) {
// Subtract timestamps to determine how long ago member was seen and convert to seconds
var lastseen = (dat.clock - dat.lastOnline)/1000
// console.log("MEMBER LAST SEEN: ", lastseen + " seconds ago" )
// If member has not been seen for more than 120 seconds, consider offline.
if(lastseen < 120){
dat.online = true
}else{
dat.online = false
}
if (plasmoid.configuration.show){
if(!dat.online){
continue;}
Expand Down Expand Up @@ -245,7 +255,7 @@ Item {
}
}

PlasmaExtras.ScrollArea {
PlasmaComponents3.ScrollView {
anchors.fill: parent

ListView {
Expand Down
Binary file modified zerotier.plasmoid
Binary file not shown.

0 comments on commit 39c5410

Please sign in to comment.