From 55f03bb47d2f7f0315914ee393436e44a2f66f9e Mon Sep 17 00:00:00 2001 From: Bastian Pedersen Date: Sat, 27 Jul 2024 12:48:29 +0200 Subject: [PATCH 1/4] Fix API validation response when joining team --- modules/web/src/main/CtrlErrors.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/web/src/main/CtrlErrors.scala b/modules/web/src/main/CtrlErrors.scala index 2f6118be370c..6bf9e96080c3 100644 --- a/modules/web/src/main/CtrlErrors.scala +++ b/modules/web/src/main/CtrlErrors.scala @@ -32,7 +32,7 @@ trait CtrlErrors extends ControllerHelpers: .mapValues: errors => JsArray: errors.map: e => - JsString(I18nKey(e.message).txt(e.args)) + JsString(I18nKey(e.message).txt(e.args.mkString)) .toMap json.validate(jsonGlobalErrorRenamer).getOrElse(json) From 541dbc0751362655db03335f04ba5fdc282861d5 Mon Sep 17 00:00:00 2001 From: Bastian Pedersen Date: Sat, 27 Jul 2024 21:21:34 +0200 Subject: [PATCH 2/4] Use vararg expansion --- modules/web/src/main/CtrlErrors.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/web/src/main/CtrlErrors.scala b/modules/web/src/main/CtrlErrors.scala index 6bf9e96080c3..66b6ced646e5 100644 --- a/modules/web/src/main/CtrlErrors.scala +++ b/modules/web/src/main/CtrlErrors.scala @@ -32,7 +32,7 @@ trait CtrlErrors extends ControllerHelpers: .mapValues: errors => JsArray: errors.map: e => - JsString(I18nKey(e.message).txt(e.args.mkString)) + JsString(I18nKey(e.message).txt(e.args*)) .toMap json.validate(jsonGlobalErrorRenamer).getOrElse(json) From 1ff819074980200e3a8e8848bbdff6924e369868 Mon Sep 17 00:00:00 2001 From: Bastian Pedersen Date: Sun, 28 Jul 2024 10:59:37 +0200 Subject: [PATCH 3/4] Add mobile OAuth scope to broadcast round endpoint --- app/controllers/RelayRound.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/RelayRound.scala b/app/controllers/RelayRound.scala index 955556a76702..152aabaf0097 100644 --- a/app/controllers/RelayRound.scala +++ b/app/controllers/RelayRound.scala @@ -114,7 +114,7 @@ final class RelayRound( json = doApiShow(id) ) - def apiShow(ts: String, rs: String, id: RelayRoundId) = AnonOrScoped(_.Study.Read): + def apiShow(ts: String, rs: String, id: RelayRoundId) = AnonOrScoped(_.Study.Read, _.Web.Mobile): doApiShow(id) private def doApiShow(id: RelayRoundId)(using Context): Fu[Result] = From 8c13c93b0604a6e046a12a1f3db343d4da73620c Mon Sep 17 00:00:00 2001 From: kraktus Date: Sun, 28 Jul 2024 11:01:39 +0200 Subject: [PATCH 4/4] Image blog: convert to png to preserve transparency fix https://github.com/lichess-org/lila/issues/15782 --- ui/bits/src/bits.cropDialog.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/bits/src/bits.cropDialog.ts b/ui/bits/src/bits.cropDialog.ts index ad3aaf3d140d..1aed230a3437 100644 --- a/ui/bits/src/bits.cropDialog.ts +++ b/ui/bits/src/bits.cropDialog.ts @@ -92,14 +92,14 @@ export async function initModule(o?: CropOpts) { maxWidth: opts.max?.pixels, maxHeight: opts.max?.pixels, }); - const tryQuality = (quality = 0.9) => { + const tryQuality = (quality = 1) => { canvas.toBlob( blob => { if (blob && blob.size < (opts.max?.megabytes ?? 100) * 1024 * 1024) submit(blob); else if (blob && quality > 0.05) tryQuality(quality * 0.9); else submit(false, 'Rendering failed'); }, - 'image/jpeg', + 'image/png', quality, ); };