aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DocumentView.tsx4
-rw-r--r--src/server/DashUploadUtils.ts19
2 files changed, 16 insertions, 7 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 74eee49e0..28d9bb69b 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -1114,7 +1114,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps
</div>
);
const targetDoc = showTitle?.startsWith('_') ? this.layoutDoc : this.rootDoc;
- const background = StrCast(SharingManager.Instance.users.find(u => u.user.email === this.dataDoc.author)?.sharingDoc.headingColor, StrCast(Doc.SharingDoc().headingColor, SettingsManager.userVariantColor));
+ const background = StrCast(SharingManager.Instance.users.find(u => u.user.email === this.dataDoc.author)?.sharingDoc.headingColor, StrCast(Doc.SharingDoc().headingColor, SettingsManager.userBackgroundColor));
const sidebarWidthPercent = +StrCast(this.layoutDoc.layout_sidebarWidthPercent).replace('%', '');
const titleView = !showTitle ? null : (
<div
@@ -1124,7 +1124,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps
position: this.headerMargin ? 'relative' : 'absolute',
height: this.titleHeight,
width: !this.headerMargin ? `calc(${sidebarWidthPercent || 100}% - 18px)` : (sidebarWidthPercent || 100) + '%', // leave room for annotation button
- color: lightOrDark(background),
+ color: background === 'transparent' ? SettingsManager.userColor : lightOrDark(background),
background,
pointerEvents: (!this.disableClickScriptFunc && this.onClickHandler) || this.Document.ignoreClick ? 'none' : this.isContentActive() || this.props.isDocumentActive?.() ? 'all' : undefined,
}}>
diff --git a/src/server/DashUploadUtils.ts b/src/server/DashUploadUtils.ts
index e5e15ce99..2bafd6b7a 100644
--- a/src/server/DashUploadUtils.ts
+++ b/src/server/DashUploadUtils.ts
@@ -385,7 +385,7 @@ export namespace DashUploadUtils {
const resolved = (filename = `upload_${Utils.GenerateGuid()}.${ext}`);
if (usingAzure()) {
const response = await AzureManager.UploadBase64ImageBlob(resolved, data);
- source = `${AzureManager.BASE_STRING}/${resolved}`;
+ source = `${AzureManager.BASE_STRING}/${resolved}`;
} else {
const error = await new Promise<Error | null>(resolve => {
writeFile(serverPathToFile(Directory.images, resolved), data, 'base64', resolve);
@@ -596,11 +596,20 @@ export namespace DashUploadUtils {
const outputPath = path.resolve(outputDirectory, (writtenFiles[suffix] = InjectSize(outputFileName, suffix)));
await new Promise<void>(async (resolve, reject) => {
const source = streamProvider();
- let readStream: Stream = source instanceof Promise ? await source : source;
+ let readStream = source instanceof Promise ? await source : source;
+ let error = false;
if (resizer) {
- readStream = readStream.pipe(resizer.withMetadata());
+ readStream = readStream.pipe(resizer.withMetadata()).on('error', async args => {
+ error = true;
+ if (error) {
+ const source2 = streamProvider();
+ let readStream2: Stream | undefined;
+ readStream2 = source2 instanceof Promise ? await source2 : source2;
+ readStream2?.pipe(createWriteStream(outputPath)).on('error', resolve).on('close', resolve);
+ }
+ });
}
- readStream.pipe(createWriteStream(outputPath)).on('close', resolve).on('error', reject);
+ !error && readStream?.pipe(createWriteStream(outputPath)).on('error', resolve).on('close', resolve);
});
}
return writtenFiles;
@@ -628,7 +637,7 @@ export namespace DashUploadUtils {
initial = undefined;
}
return {
- resizer: initial,
+ resizer: suffix === '_o' ? undefined : initial,
suffix,
};
}),