mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
ChatResource: prevent unnecessary state update
This commit is contained in:
parent
47c19b60c0
commit
f79e489d67
@ -75,7 +75,14 @@ export function ChatResource(props: ChatResourceProps) {
|
||||
);
|
||||
|
||||
const clearUnsent = useCallback(
|
||||
() => setUnsent(s => _.omit(s, station)),
|
||||
() => {
|
||||
setUnsent(s => {
|
||||
if(station in s) {
|
||||
return _.omit(s, station);
|
||||
}
|
||||
return s;
|
||||
});
|
||||
},
|
||||
[station]
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user