fix(settings/options/language): key not found because language wasn't loaded yet
This commit is contained in:
@@ -42,7 +42,8 @@ onRender((ctx) => {
|
|||||||
ctx.textBaseline = "top";
|
ctx.textBaseline = "top";
|
||||||
ctx.fillStyle = "#ffffff";
|
ctx.fillStyle = "#ffffff";
|
||||||
|
|
||||||
const lines = confirmationModal.text.split("\n").slice(0, MAX_LINES);
|
const rawText = typeof confirmationModal.text === "function" ? confirmationModal.text() : confirmationModal.text;
|
||||||
|
const lines = rawText.split("\n").slice(0, MAX_LINES);
|
||||||
const totalTextHeight = lines.length * LINE_HEIGHT;
|
const totalTextHeight = lines.length * LINE_HEIGHT;
|
||||||
const textStartY = BG_Y + Math.floor((BG_HEIGHT - totalTextHeight) / 2) - 2;
|
const textStartY = BG_Y + Math.floor((BG_HEIGHT - totalTextHeight) / 2) - 2;
|
||||||
|
|
||||||
|
|||||||
@@ -176,11 +176,7 @@ const handleActivateA = () => {
|
|||||||
setLocale(selectedLocale.code);
|
setLocale(selectedLocale.code);
|
||||||
|
|
||||||
confirmationModal.open({
|
confirmationModal.open({
|
||||||
text: $t(
|
text: () => $t("settings.options.language.confirmation"),
|
||||||
"settings.options.language.confirmation",
|
|
||||||
{},
|
|
||||||
{ locale: selectedLocale.code },
|
|
||||||
),
|
|
||||||
onClosed: async () => {
|
onClosed: async () => {
|
||||||
await animateOutro();
|
await animateOutro();
|
||||||
store.closeSubMenu(true);
|
store.closeSubMenu(true);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const MODAL_TIME = 0.25;
|
|||||||
export const useConfirmationModal = defineStore("confirmationModal", {
|
export const useConfirmationModal = defineStore("confirmationModal", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
isOpen: false,
|
isOpen: false,
|
||||||
text: "",
|
text: "" as string | (() => string),
|
||||||
aLabel: null as string | null,
|
aLabel: null as string | null,
|
||||||
bLabel: null as string | null,
|
bLabel: null as string | null,
|
||||||
onActivateA: null as (() => void) | null,
|
onActivateA: null as (() => void) | null,
|
||||||
@@ -24,7 +24,7 @@ export const useConfirmationModal = defineStore("confirmationModal", {
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
open(options: {
|
open(options: {
|
||||||
text: string;
|
text: string | (() => string);
|
||||||
aLabel?: string;
|
aLabel?: string;
|
||||||
bLabel?: string;
|
bLabel?: string;
|
||||||
onActivateA?: () => void;
|
onActivateA?: () => void;
|
||||||
|
|||||||
Reference in New Issue
Block a user