Browse Source

Fix replacing input with new after peer changing

master
Eduard Kuzmenko 4 years ago
parent
commit
e56c729880
  1. 5
      src/components/chat/input.ts
  2. 2
      src/lib/appManagers/appStateManager.ts
  3. 1
      src/scss/partials/_input.scss
  4. 4
      src/scss/partials/pages/_pages.scss

5
src/components/chat/input.ts

@ -535,6 +535,7 @@ export default class ChatInput { @@ -535,6 +535,7 @@ export default class ChatInput {
}
private attachMessageInputField() {
const oldInput = this.messageInputField?.input;
this.messageInputField = new InputField({
placeholder: 'Message',
name: 'message'
@ -545,8 +546,8 @@ export default class ChatInput { @@ -545,8 +546,8 @@ export default class ChatInput {
this.attachMessageInputListeners();
const container = this.inputScroll.container;
if(container.firstElementChild) {
container.replaceChild(this.messageInputField.input, container.firstElementChild);
if(oldInput) {
oldInput.replaceWith(this.messageInputField.input);
} else {
container.append(this.messageInputField.input);
}

2
src/lib/appManagers/appStateManager.ts

@ -60,7 +60,7 @@ export class AppStateManager extends EventListenerBase<{ @@ -60,7 +60,7 @@ export class AppStateManager extends EventListenerBase<{
if(state) {
if(state.version != STATE_VERSION) {
state = {};
} else if(((state.stateCreatedTime || 0) + REFRESH_EVERY) < time && false) {
} else if(((state.stateCreatedTime || 0) + REFRESH_EVERY) < time/* && false */) {
this.log('will refresh state', state.stateCreatedTime, time);
REFRESH_KEYS.forEach(key => {
delete state[key];

1
src/scss/partials/_input.scss

@ -61,7 +61,6 @@ @@ -61,7 +61,6 @@
transition: .2s border-color;
position: relative;
z-index: 1;
text-align: left;
//line-height: calc(54px - var(--border-width));
/* overflow: hidden;
white-space: nowrap; */

4
src/scss/partials/pages/_pages.scss

@ -193,4 +193,8 @@ @@ -193,4 +193,8 @@
margin-top: 100px;
}
}
.input-field {
text-align: center;
}
}
Loading…
Cancel
Save