mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +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