Tweak private / underscores for fields and methods

This commit is contained in:
J. Ryan Stinnett
2021-04-26 14:02:53 +01:00
parent f34489e2df
commit b8a915bb76
17 changed files with 324 additions and 325 deletions
+5 -5
View File
@@ -25,7 +25,7 @@ const TYPING_SERVER_TIMEOUT = 30000;
* Tracks typing state for users.
*/
export default class TypingStore {
private _typingStates: {
private typingStates: {
[roomId: string]: {
isTyping: boolean,
userTimer: Timer,
@@ -49,7 +49,7 @@ export default class TypingStore {
* MatrixClientPeg client changes.
*/
reset() {
this._typingStates = {
this.typingStates = {
// "roomId": {
// isTyping: bool, // Whether the user is typing or not
// userTimer: Timer, // Local timeout for "user has stopped typing"
@@ -67,14 +67,14 @@ export default class TypingStore {
if (!SettingsStore.getValue('sendTypingNotifications')) return;
if (SettingsStore.getValue('lowBandwidth')) return;
let currentTyping = this._typingStates[roomId];
let currentTyping = this.typingStates[roomId];
if ((!isTyping && !currentTyping) || (currentTyping && currentTyping.isTyping === isTyping)) {
// No change in state, so don't do anything. We'll let the timer run its course.
return;
}
if (!currentTyping) {
currentTyping = this._typingStates[roomId] = {
currentTyping = this.typingStates[roomId] = {
isTyping: isTyping,
serverTimer: new Timer(TYPING_SERVER_TIMEOUT),
userTimer: new Timer(TYPING_USER_TIMEOUT),
@@ -86,7 +86,7 @@ export default class TypingStore {
if (isTyping) {
if (!currentTyping.serverTimer.isRunning()) {
currentTyping.serverTimer.restart().finished().then(() => {
const currentTyping = this._typingStates[roomId];
const currentTyping = this.typingStates[roomId];
if (currentTyping) currentTyping.isTyping = false;
// The server will (should) time us out on typing, so we don't