Merge pull request #249 from vector-im/bwindels/ui-sent-status

show message already as black when sent but no remote echo yet
This commit is contained in:
Bruno Windels 2021-03-03 13:08:46 +00:00 committed by GitHub
commit 961d0cb224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View file

@ -16,6 +16,7 @@ limitations under the License.
import {UpdateAction} from "../UpdateAction.js";
import {ViewModel} from "../../../../ViewModel.js";
import {SendStatus} from "../../../../../matrix/room/sending/PendingEvent.js";
export class SimpleTile extends ViewModel {
constructor(options) {
@ -47,6 +48,10 @@ export class SimpleTile extends ViewModel {
return this._entry.isPending;
}
get isUnsent() {
return this._entry.isPending && this._entry.status !== SendStatus.Sent;
}
abortSending() {
this._entry.pendingEvent?.abort();
}

View file

@ -159,7 +159,7 @@ a {
margin-left: auto;
}
.TextMessageView.pending .message-container {
.TextMessageView.unsent .message-container {
background-color: #333;
}

View file

@ -624,7 +624,7 @@ only loads when the top comes into view*/
align-self: start;
}
.TextMessageView.pending .message-container {
.TextMessageView.unsent .message-container {
color: #ccc;
}

View file

@ -21,7 +21,7 @@ export function renderMessage(t, vm, children) {
const classes = {
"TextMessageView": true,
own: vm.isOwn,
pending: vm.isPending,
unsent: vm.isUnsent,
unverified: vm.isUnverified,
continuation: vm => vm.isContinuation,
messageStatus: vm => vm.shape === "message-status" || vm.shape === "missing-attachment" || vm.shape === "file",