Merge remote-tracking branch 'origin/develop' into migrate/vuex-to-pinia
This commit is contained in:
commit
6dfb213dfe
12 changed files with 814 additions and 516 deletions
|
|
@ -76,9 +76,9 @@ const mediaUpload = {
|
|||
const testCanvas = document.createElement('canvas')
|
||||
const supportsWebP = testCanvas.toDataURL('image/webp').startsWith('data:image/webp')
|
||||
|
||||
// Convert to WebP if supported, otherwise JPEG
|
||||
const type = supportsWebP ? 'image/webp' : 'image/jpeg'
|
||||
const extension = supportsWebP ? '.webp' : '.jpg'
|
||||
// Convert to WebP if supported and alwaysUseJpeg is false, otherwise JPEG
|
||||
const type = (!this.$store.getters.mergedConfig.alwaysUseJpeg && supportsWebP) ? 'image/webp' : 'image/jpeg'
|
||||
const extension = type === 'image/webp' ? '.webp' : '.jpg'
|
||||
|
||||
// Remove the original extension and add new one
|
||||
const newFileName = file.name.replace(/\.[^/.]+$/, '') + extension
|
||||
|
|
|
|||
|
|
@ -269,6 +269,14 @@
|
|||
{{ $t('settings.image_compression') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting
|
||||
path="alwaysUseJpeg"
|
||||
expert="1"
|
||||
>
|
||||
{{ $t('settings.always_use_jpeg') }}
|
||||
</BooleanSetting>
|
||||
</li>
|
||||
<li>
|
||||
<BooleanSetting
|
||||
path="useContainFit"
|
||||
|
|
|
|||
|
|
@ -440,6 +440,7 @@
|
|||
"attachmentRadius": "Attachments",
|
||||
"attachments": "Attachments",
|
||||
"image_compression": "Compress images before uploading",
|
||||
"always_use_jpeg": "Always convert images to JPEG format",
|
||||
"avatar": "Avatar",
|
||||
"avatarAltRadius": "Avatars (notifications)",
|
||||
"avatarRadius": "Avatars",
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ export const multiChoiceProperties = [
|
|||
'unsavedPostAction' // save | discard | confirm
|
||||
]
|
||||
|
||||
console.log('TEST', defaultState)
|
||||
|
||||
// caching the instance default properties
|
||||
export const instanceDefaultProperties = Object.entries(defaultState)
|
||||
.filter(([key, value]) => value === undefined)
|
||||
|
|
|
|||
|
|
@ -160,5 +160,6 @@ export const defaultState = {
|
|||
useAbsoluteTimeFormat: undefined, // instance default
|
||||
absoluteTimeFormatMinAge: undefined, // instance default
|
||||
absoluteTime12h: undefined, // instance default
|
||||
imageCompression: true
|
||||
imageCompression: true,
|
||||
alwaysUseJpeg: false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ export const _getRecentData = (cache, live, isTest) => {
|
|||
}
|
||||
|
||||
const merge = (a, b) => ({
|
||||
_user: a._user ?? b._user,
|
||||
_version: a._version ?? b._version,
|
||||
_timestamp: a._timestamp ?? b._timestamp,
|
||||
needUpload: b.needUpload ?? a.needUpload,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue