Fix Connecting spinner in dark mode, maintain draft attachment order

This commit is contained in:
Scott Nonnenberg 2021-09-07 17:11:17 -07:00 committed by GitHub
parent 561bc0695f
commit 9ada9f6a47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 5 deletions

View file

@ -4443,10 +4443,22 @@ button.module-image__border-overlay:focus {
.module-spinner__circle--small {
-webkit-mask: url('../images/spinner-track-24.svg') no-repeat center;
-webkit-mask-size: 100%;
// For specificity
@include dark-theme {
-webkit-mask: url('../images/spinner-track-24.svg') no-repeat center;
-webkit-mask-size: 100%;
}
}
.module-spinner__arc--small {
-webkit-mask: url('../images/spinner-24.svg') no-repeat center;
-webkit-mask-size: 100%;
// For specificity
@include dark-theme {
-webkit-mask: url('../images/spinner-24.svg') no-repeat center;
-webkit-mask-size: 100%;
}
}
.module-spinner__circle--incoming {

View file

@ -33,6 +33,11 @@
&__spinner {
&__arc {
background-color: $color-black;
// Needed for specificity
@include dark-theme {
background-color: $color-black;
}
}
&__circle {

View file

@ -1913,12 +1913,24 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
const onDisk = await this.writeDraftAttachment(attachment);
// Remove any pending attachments that were transcoding
const draftAttachments = (this.model.get('draftAttachments') || []).filter(
draftAttachment => draftAttachment.path !== attachment.path
const draftAttachments = this.model.get('draftAttachments') || [];
const index = draftAttachments.findIndex(
draftAttachment => draftAttachment.path === attachment.path
);
this.model.set({
draftAttachments: [onDisk, ...draftAttachments],
});
if (index < 0) {
window.log.warn(
`addAttachment: Failed to find pending attachment with path ${attachment.path}`
);
this.model.set({
draftAttachments: [...draftAttachments, onDisk],
});
} else {
const toUpdate = [...draftAttachments];
toUpdate.splice(index, 1, onDisk);
this.model.set({
draftAttachments: toUpdate,
});
}
this.updateAttachmentsView();
await this.saveModel();