Skip to content

Commit

Permalink
Fix Connecting spinner in dark mode, maintain draft attachment order
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Sep 8, 2021
1 parent 561bc06 commit 9ada9f6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
12 changes: 12 additions & 0 deletions stylesheets/_modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions stylesheets/components/LeftPaneDialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
&__spinner {
&__arc {
background-color: $color-black;

// Needed for specificity
@include dark-theme {
background-color: $color-black;
}
}

&__circle {
Expand Down
22 changes: 17 additions & 5 deletions ts/views/conversation_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9ada9f6

Please sign in to comment.