[Update] Main Page: Message Input Box Ratio. Save the ratio when window is resized.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useStore_MessageInputBoxRatio } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
import { clampMinMax } from "@utils/clampMinMax";
|
||||
export const useMessageInputBoxRatio = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentMessageInputBoxRatio, updateMessageInputBoxRatio } = useStore_MessageInputBoxRatio();
|
||||
@@ -10,7 +10,9 @@ export const useMessageInputBoxRatio = () => {
|
||||
};
|
||||
|
||||
const setMessageInputBoxRatio = (ratio) => {
|
||||
asyncStdoutToPython("/set/data/message_box_ratio", parseFloat(ratio.toFixed(2)));
|
||||
const parsed = parseFloat(ratio.toFixed(2));
|
||||
const valid_ratio = clampMinMax(parsed, 1, 99);
|
||||
asyncStdoutToPython("/set/data/message_box_ratio", valid_ratio);
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user