Merge pull request #2282 from urbit/fix-remove

contacts: improve remove from group experience in UI and terminal log
This commit is contained in:
Logan 2020-02-13 11:08:12 -08:00 committed by GitHub
commit f316d0f118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 14 deletions

View File

@ -189,13 +189,7 @@
?~ saw
[~ state]
?> ?=(^ wir)
:_ state(synced (~(del by synced) t.wir))
%. ~
%- slog
:* leaf+"contact-hook failed subscribe on {(spud t.wir)}"
leaf+"stack trace:"
u.saw
==
[~ state(synced (~(del by synced) t.wir))]
::
++ kick
|= wir=wire
@ -208,9 +202,7 @@
[%pass /group %agent [our.bol %group-store] %watch /updates]~
::
[%contacts @ *]
~& contacts-kick+wir
?. (~(has by synced) t.wir) ~
~& %contact-hook-resubscribe
=/ =ship (~(got by synced) t.wir)
?: =(ship our.bol)
[%pass wir %agent [our.bol %contact-store] %watch wir]~

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -480,9 +480,11 @@ export class ContactCard extends Component {
let localOpt =
((props.ship === window.ship) && (props.path === "/~/default"))
? "dib" : "dn";
let adminOpt =
(props.path.includes(window.ship) || (props.ship === window.ship))
? "dib" : "dn";
( (props.path.includes(window.ship) || (props.ship === window.ship)) &&
!(props.path.includes('/~/default'))
) ? "dib" : "dn";
let card = state.edit ? this.renderEditCard() : this.renderCard();
@ -512,7 +514,10 @@ export class ContactCard extends Component {
`ml3 mt2 mb2 f9 pa1 ba red2 br2 b--red2 pointer ` + adminOpt
}
onClick={this.removeFromGroup}>
Remove from Group
{(
props.ship === window.ship && props.path.includes(window.ship)
? "Delete Group" : "Remove from Group"
)}
</button>
</div>
<div className="h-100 w-100 overflow-x-hidden pb8">{card}</div>