Merge pull request 'Fixed double messaging when live typing' (#45) from BordedDev/snek:bugfix/live-typing into main
Reviewed-on: retoor/snek#45
This commit is contained in:
		
						commit
						234edf4756
					
				@ -191,9 +191,7 @@ levenshteinDistance(a, b) {
 | 
			
		||||
        e.preventDefault();
 | 
			
		||||
 | 
			
		||||
        const message = me.replaceMentionsWithAuthors(this.value);
 | 
			
		||||
        this.messageUid = null;
 | 
			
		||||
        this.value = "";
 | 
			
		||||
        this.previousValue = "";
 | 
			
		||||
        e.target.value = "";
 | 
			
		||||
 | 
			
		||||
        if (!message) {
 | 
			
		||||
          return;
 | 
			
		||||
@ -208,12 +206,11 @@ levenshteinDistance(a, b) {
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        e.target.value = "";
 | 
			
		||||
        this.updateMessage()
 | 
			
		||||
 | 
			
		||||
        this.value = "";
 | 
			
		||||
        this.previousValue = "";
 | 
			
		||||
        this.messageUid = null;
 | 
			
		||||
        this.sendMessage(this.channelUid, message).then((uid) => {
 | 
			
		||||
          this.messageUid = uid;
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
@ -260,7 +257,9 @@ levenshteinDistance(a, b) {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this.sendMessage(this.channelUid, this.value).then((uid) => {
 | 
			
		||||
        if (this.liveType) {
 | 
			
		||||
            this.messageUid = uid;
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user