[Update] Resend Message Button: To be store-able the status.
Move to Appearance settings.
This commit is contained in:
28
src-ui/logics/configs/appearance/useShowResendButton.js
Normal file
28
src-ui/logics/configs/appearance/useShowResendButton.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { useStore_ShowResendButton } from "@store";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useShowResendButton = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentShowResendButton, updateShowResendButton, pendingShowResendButton } = useStore_ShowResendButton();
|
||||
|
||||
const getShowResendButton = () => {
|
||||
pendingShowResendButton();
|
||||
asyncStdoutToPython("/get/data/show_resend_button");
|
||||
};
|
||||
|
||||
const toggleShowResendButton = () => {
|
||||
pendingShowResendButton();
|
||||
if (currentShowResendButton.data) {
|
||||
asyncStdoutToPython("/set/disable/show_resend_button");
|
||||
} else {
|
||||
asyncStdoutToPython("/set/enable/show_resend_button");
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
currentShowResendButton,
|
||||
getShowResendButton,
|
||||
updateShowResendButton,
|
||||
toggleShowResendButton,
|
||||
};
|
||||
};
|
||||
@@ -4,6 +4,7 @@ export { useMessageLogUiScaling } from "./appearance/useMessageLogUiScaling";
|
||||
export { useSelectedFontFamily } from "./appearance/useSelectedFontFamily";
|
||||
export { useTransparency } from "./appearance/useTransparency";
|
||||
export { useSendMessageButtonType } from "./others/useSendMessageButtonType";
|
||||
export { useShowResendButton } from "./appearance/useShowResendButton";
|
||||
export { useUiLanguage } from "./appearance/useUiLanguage";
|
||||
export { useUiScaling } from "./appearance/useUiScaling";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
export { useIsVisibleResendButton } from "./useIsVisibleResendButton";
|
||||
export { useIsMainPageCompactMode } from "./useIsMainPageCompactMode";
|
||||
export { useLanguageSettings } from "./useLanguageSettings";
|
||||
export { useMainFunction } from "./useMainFunction";
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { useStore_IsVisibleResendButton } from "@store";
|
||||
|
||||
export const useIsVisibleResendButton = () => {
|
||||
const { currentIsVisibleResendButton, updateIsVisibleResendButton } = useStore_IsVisibleResendButton();
|
||||
|
||||
const toggleIsVisibleResendButton = () => {
|
||||
updateIsVisibleResendButton(!currentIsVisibleResendButton.data);
|
||||
};
|
||||
|
||||
return {
|
||||
currentIsVisibleResendButton,
|
||||
toggleIsVisibleResendButton,
|
||||
updateIsVisibleResendButton,
|
||||
};
|
||||
};
|
||||
@@ -149,6 +149,10 @@ export const ROUTE_META_LIST = [
|
||||
{ endpoint: "/get/data/send_message_button_type", ns: configs, hook_name: "useSendMessageButtonType", method_name: "updateSendMessageButtonType" },
|
||||
{ endpoint: "/set/data/send_message_button_type", ns: configs, hook_name: "useSendMessageButtonType", method_name: "updateSendMessageButtonType" },
|
||||
|
||||
{ endpoint: "/get/data/show_resend_button", ns: configs, hook_name: "useShowResendButton", method_name: "updateShowResendButton" },
|
||||
{ endpoint: "/set/enable/show_resend_button", ns: configs, hook_name: "useShowResendButton", method_name: "updateShowResendButton" },
|
||||
{ endpoint: "/set/disable/show_resend_button", ns: configs, hook_name: "useShowResendButton", method_name: "updateShowResendButton" },
|
||||
|
||||
{ endpoint: "/get/data/font_family", ns: configs, hook_name: "useSelectedFontFamily", method_name: "updateSelectedFontFamily" },
|
||||
{ endpoint: "/set/data/font_family", ns: configs, hook_name: "useSelectedFontFamily", method_name: "updateSelectedFontFamily" },
|
||||
|
||||
|
||||
Reference in New Issue
Block a user