2019-07-07 23:52:41 -04:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
2019-07-13 05:39:01 -04:00
|
|
|
import QtQuick 2.12
|
2019-07-04 16:01:44 -04:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
import "../Base"
|
|
|
|
|
|
|
|
HListModel {
|
2019-07-18 04:17:35 -04:00
|
|
|
function find(userId) {
|
2019-07-07 22:36:12 -04:00
|
|
|
// Happens when SortFilterProxyModel ExpressionFilter/Sorter/Role tests
|
|
|
|
// the expression with invalid data to establish property bindings
|
2019-07-18 04:17:35 -04:00
|
|
|
if (! userId) { return }
|
2019-07-07 22:36:12 -04:00
|
|
|
|
2019-07-21 08:38:49 -04:00
|
|
|
let found = getWhere({userId}, 1)[0]
|
|
|
|
if (found) { return found }
|
2019-07-04 16:01:44 -04:00
|
|
|
|
2019-07-18 04:17:35 -04:00
|
|
|
py.callCoro("request_user_update_event", [userId])
|
2019-07-07 01:37:13 -04:00
|
|
|
|
|
|
|
return {
|
2019-07-18 04:17:35 -04:00
|
|
|
userId,
|
2019-07-21 07:14:16 -04:00
|
|
|
displayName: "",
|
|
|
|
avatarUrl: "",
|
|
|
|
loading: true,
|
2019-07-07 01:37:13 -04:00
|
|
|
}
|
2019-07-04 16:01:44 -04:00
|
|
|
}
|
|
|
|
}
|