forked from cory/tildefriends
Make the wiki app use the global id picker.
This commit is contained in:
@ -31,13 +31,16 @@ class TfCollectionsAppElement extends LitElement {
|
||||
tfrpc.register(function hash_changed(hash) {
|
||||
self.notify_hash_changed(hash);
|
||||
});
|
||||
tfrpc.register(function setActiveIdentity(id) {
|
||||
self.whoami = id;
|
||||
});
|
||||
tfrpc.rpc.get_hash().then((hash) => self.notify_hash_changed(hash));
|
||||
}
|
||||
|
||||
async load() {
|
||||
this.ids = await tfrpc.rpc.getIdentities();
|
||||
this.owner_ids = await tfrpc.rpc.getOwnerIdentities();
|
||||
this.whoami = await tfrpc.rpc.localStorageGet('collections_whoami');
|
||||
this.whoami = await tfrpc.rpc.getActiveIdentity();
|
||||
let ids = [...new Set([...this.owner_ids, this.whoami])].sort();
|
||||
this.following = Object.keys(await tfrpc.rpc.following(ids, 1)).sort();
|
||||
|
||||
@ -273,9 +276,6 @@ class TfCollectionsAppElement extends LitElement {
|
||||
margin-right: 16px;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<tf-id-picker .ids=${this.ids} selected=${this.whoami} @change=${this.on_whoami_changed} ?hidden=${!this.ids?.length}></tf-id-picker>
|
||||
</div>
|
||||
<div>
|
||||
${keyed(
|
||||
this.whoami,
|
||||
|
Reference in New Issue
Block a user