fix sds resizing

This commit is contained in:
nocnico
2025-06-08 13:36:11 +02:00
parent fa3757e1ee
commit fc3272bca5

View File

@@ -132,10 +132,7 @@ export const useMrtStore = create<MrtStore>(
} }
case "sds": { case "sds": {
const { sdsMessage } = pageData as SetSdsPageParams; const { sdsMessage } = pageData as SetSdsPageParams;
const maxLen = 60;
const msg = sdsMessage.data.message; const msg = sdsMessage.data.message;
const safeMsg =
typeof msg === "string" && msg.length > maxLen ? msg.slice(0, maxLen) + "…" : msg;
set({ set({
page: "sds", page: "sds",
lines: [ lines: [
@@ -145,15 +142,17 @@ export const useMrtStore = create<MrtStore>(
textSize: "2", textSize: "2",
}, },
{ {
textLeft: safeMsg, textLeft: msg,
style: { style: {
whiteSpace: "normal", whiteSpace: "normal",
overflow: "hidden", overflowWrap: "break-word",
textOverflow: "ellipsis",
maxWidth: "100%",
width: "100%",
display: "block",
wordBreak: "break-word", wordBreak: "break-word",
display: "block",
maxWidth: "100%",
maxHeight: "100%",
overflow: "auto",
textOverflow: "ellipsis",
lineHeight: "1.2em",
}, },
textSize: "2", textSize: "2",
}, },