A few bug fixes
This commit is contained in:
parent
4b28fd896a
commit
2aa2aca9f2
6 changed files with 76 additions and 27 deletions
|
@ -11542,9 +11542,6 @@ $contact-modal-padding: 18px;
|
||||||
|
|
||||||
// To limit messages with things forcing them wider, like long attachment names
|
// To limit messages with things forcing them wider, like long attachment names
|
||||||
.module-message__container {
|
.module-message__container {
|
||||||
// 2px to allow for 1px border
|
|
||||||
max-width: 302px;
|
|
||||||
|
|
||||||
&--incoming {
|
&--incoming {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
}
|
}
|
||||||
|
@ -11679,15 +11676,20 @@ $contact-modal-padding: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Spec: container < 437px */
|
||||||
|
@media (min-width: 0px) and (max-width: 799px) {
|
||||||
|
.module-message {
|
||||||
|
// Add 2px for 1px border
|
||||||
|
max-width: 302px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Spec: container > 438px and container < 593px */
|
/* Spec: container > 438px and container < 593px */
|
||||||
@media (min-width: 800px) and (max-width: 925px) {
|
@media (min-width: 800px) and (max-width: 925px) {
|
||||||
.module-message {
|
.module-message {
|
||||||
// Add 2px for 1px border
|
// Add 2px for 1px border
|
||||||
max-width: 376px;
|
max-width: 376px;
|
||||||
}
|
}
|
||||||
.module-message__container {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Spec: container < 438px
|
// Spec: container < 438px
|
||||||
.module-message--incoming {
|
.module-message--incoming {
|
||||||
|
@ -11722,9 +11724,6 @@ $contact-modal-padding: 18px;
|
||||||
.module-message {
|
.module-message {
|
||||||
max-width: 66%;
|
max-width: 66%;
|
||||||
}
|
}
|
||||||
.module-message__container {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.module-message--incoming {
|
.module-message--incoming {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|
|
@ -626,7 +626,17 @@ type WhatIsThis = import('./window.d').WhatIsThis;
|
||||||
Views.Initialization.setMessage(window.i18n('optimizingApplication'));
|
Views.Initialization.setMessage(window.i18n('optimizingApplication'));
|
||||||
|
|
||||||
if (newVersion) {
|
if (newVersion) {
|
||||||
await window.Signal.Data.cleanupOrphanedAttachments();
|
// We've received reports that this update can take longer than two minutes, so we
|
||||||
|
// allow it to continue and just move on in that timeout case.
|
||||||
|
try {
|
||||||
|
await window.Signal.Data.cleanupOrphanedAttachments();
|
||||||
|
} catch (error) {
|
||||||
|
window.log.error(
|
||||||
|
'background: Failed to cleanup orphaned attachments:',
|
||||||
|
error && error.stack ? error.stack : error
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Don't block on the following operation
|
// Don't block on the following operation
|
||||||
window.Signal.Data.ensureFilePermissions();
|
window.Signal.Data.ensureFilePermissions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -755,6 +755,23 @@ story.add('Other File Type with Caption', () => {
|
||||||
return renderBothDirections(props);
|
return renderBothDirections(props);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
story.add('Other File Type with Long Filename', () => {
|
||||||
|
const props = createProps({
|
||||||
|
attachments: [
|
||||||
|
{
|
||||||
|
contentType: 'text/plain' as MIMEType,
|
||||||
|
fileName:
|
||||||
|
'INSERT-APP-NAME_INSERT-APP-APPLE-ID_AppStore_AppsGamesWatch.psd.zip',
|
||||||
|
url: 'a2/a2334324darewer4234',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
status: 'sent',
|
||||||
|
text: 'This is what I have done.',
|
||||||
|
});
|
||||||
|
|
||||||
|
return renderBothDirections(props);
|
||||||
|
});
|
||||||
|
|
||||||
story.add('TapToView Image', () => {
|
story.add('TapToView Image', () => {
|
||||||
const props = createProps({
|
const props = createProps({
|
||||||
attachments: [
|
attachments: [
|
||||||
|
|
|
@ -2803,11 +2803,7 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
attachments
|
attachments
|
||||||
.filter(
|
.filter(
|
||||||
attachment =>
|
attachment => attachment && !attachment.pending && !attachment.error
|
||||||
attachment &&
|
|
||||||
attachment.contentType &&
|
|
||||||
!attachment.pending &&
|
|
||||||
!attachment.error
|
|
||||||
)
|
)
|
||||||
.slice(0, 1)
|
.slice(0, 1)
|
||||||
.map(async attachment => {
|
.map(async attachment => {
|
||||||
|
|
|
@ -424,7 +424,7 @@ export const getConversationSelector = createSelector(
|
||||||
if (onE164) {
|
if (onE164) {
|
||||||
return selector(onE164);
|
return selector(onE164);
|
||||||
}
|
}
|
||||||
const onUuid = getOwn(byUuid, id);
|
const onUuid = getOwn(byUuid, id.toLowerCase ? id.toLowerCase() : id);
|
||||||
if (onUuid) {
|
if (onUuid) {
|
||||||
return selector(onUuid);
|
return selector(onUuid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1372,8 +1372,15 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
const { files } = e.originalEvent.dataTransfer;
|
const { files } = e.originalEvent.dataTransfer;
|
||||||
for (let i = 0, max = files.length; i < max; i += 1) {
|
for (let i = 0, max = files.length; i < max; i += 1) {
|
||||||
const file = files[i];
|
const file = files[i];
|
||||||
// eslint-disable-next-line no-await-in-loop
|
try {
|
||||||
await this.maybeAddAttachment(file);
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await this.maybeAddAttachment(file);
|
||||||
|
} catch (error) {
|
||||||
|
window.log.error(
|
||||||
|
'ConversationView/onDrop: Failed to add attachment:',
|
||||||
|
error && error.stack ? error.stack : error
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1399,12 +1406,23 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// In conversation model/redux
|
// In conversation model/redux
|
||||||
attachments: draftAttachments.map((attachment: any) => ({
|
attachments: draftAttachments.map((attachment: any) => {
|
||||||
...attachment,
|
let url = '';
|
||||||
url: attachment.screenshotPath
|
if (attachment.screenshotPath) {
|
||||||
? getAbsoluteDraftPath(attachment.screenshotPath)
|
url = getAbsoluteDraftPath(attachment.screenshotPath);
|
||||||
: getAbsoluteDraftPath(attachment.path),
|
} else if (attachment.path) {
|
||||||
})),
|
url = getAbsoluteDraftPath(attachment.path);
|
||||||
|
} else {
|
||||||
|
window.log.warn(
|
||||||
|
'getPropsForAttachmentList: Attachment was missing both screenshotPath and path fields'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...attachment,
|
||||||
|
url,
|
||||||
|
};
|
||||||
|
}),
|
||||||
// Passed in from ConversationView
|
// Passed in from ConversationView
|
||||||
onAddAttachment: this.onChooseAttachment.bind(this),
|
onAddAttachment: this.onChooseAttachment.bind(this),
|
||||||
onClickAttachment: this.onClickAttachment.bind(this),
|
onClickAttachment: this.onClickAttachment.bind(this),
|
||||||
|
@ -1479,9 +1497,9 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
draftAttachments: [...draftAttachments, onDisk],
|
draftAttachments: [...draftAttachments, onDisk],
|
||||||
draftChanged: true,
|
draftChanged: true,
|
||||||
});
|
});
|
||||||
await this.saveModel();
|
|
||||||
|
|
||||||
this.updateAttachmentsView();
|
this.updateAttachmentsView();
|
||||||
|
|
||||||
|
await this.saveModel();
|
||||||
},
|
},
|
||||||
|
|
||||||
async onCloseAttachment(attachment: any) {
|
async onCloseAttachment(attachment: any) {
|
||||||
|
@ -1701,7 +1719,16 @@ Whisper.ConversationView = Whisper.View.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.addAttachment(attachment);
|
try {
|
||||||
|
await this.addAttachment(attachment);
|
||||||
|
} catch (error) {
|
||||||
|
window.log.error(
|
||||||
|
'Error saving draft attachment:',
|
||||||
|
error && error.stack ? error.stack : error
|
||||||
|
);
|
||||||
|
|
||||||
|
this.showToast(Whisper.UnableToLoadToast);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isSizeOkay(attachment: any) {
|
isSizeOkay(attachment: any) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue