mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Chat avatar fixes (#9103)
* Ensured rejection doesn't hurt performance * Added debounce and scroll removal * Added debounce for keydown * Fixed linting
This commit is contained in:
committed by
Sabe Jones
parent
dc3a02bc2e
commit
7671347d3a
@@ -350,6 +350,7 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce';
|
||||
import { mapState } from 'client/libs/store';
|
||||
|
||||
import { TAVERN_ID } from '../../../common/script/constants';
|
||||
@@ -527,7 +528,10 @@ export default {
|
||||
};
|
||||
document.body.removeChild(div);
|
||||
},
|
||||
updateCarretPosition (eventUpdate) {
|
||||
updateCarretPosition: debounce(function updateCarretPosition (eventUpdate) {
|
||||
this._updateCarretPosition(eventUpdate);
|
||||
}, 250),
|
||||
_updateCarretPosition (eventUpdate) {
|
||||
if (eventUpdate.metaKey && eventUpdate.keyCode === 13) {
|
||||
this.sendMessage();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user