mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: add more memo settings
This commit is contained in:
@ -142,6 +142,24 @@ const WorkspaceSection = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const handleMemoEnableAutoCompact = async (value: boolean) => {
|
||||
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, enableAutoCompact: value };
|
||||
setWorkspaceMemoRelatedSetting(update);
|
||||
await workspaceSettingStore.setWorkspaceSetting({
|
||||
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.MEMO_RELATED}`,
|
||||
memoRelatedSetting: update,
|
||||
});
|
||||
};
|
||||
|
||||
const handleMemoEnableDoubleClickToEdit = async (value: boolean) => {
|
||||
const update: WorkspaceMemoRelatedSetting = { ...workspaceMemoRelatedSetting, enableDoubleClickEdit: value };
|
||||
setWorkspaceMemoRelatedSetting(update);
|
||||
await workspaceSettingStore.setWorkspaceSetting({
|
||||
name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.MEMO_RELATED}`,
|
||||
memoRelatedSetting: update,
|
||||
});
|
||||
};
|
||||
|
||||
const handleMemoContentLengthLimitChanges = async (value: number) => {
|
||||
if (value < 8 * 1024) {
|
||||
toast.error("Content length limit should be greater than 8KB");
|
||||
@ -271,6 +289,20 @@ const WorkspaceSection = () => {
|
||||
onChange={(event) => handleMemoDisplayWithUpdatedTs(event.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full flex flex-row justify-between items-center">
|
||||
<span>{t("setting.system-section.enable-auto-compact")}</span>
|
||||
<Switch
|
||||
checked={workspaceMemoRelatedSetting.enableAutoCompact}
|
||||
onChange={(event) => handleMemoEnableAutoCompact(event.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full flex flex-row justify-between items-center">
|
||||
<span>{t("setting.system-section.enable-double-click-to-edit")}</span>
|
||||
<Switch
|
||||
checked={workspaceMemoRelatedSetting.enableDoubleClickEdit}
|
||||
onChange={(event) => handleMemoEnableDoubleClickToEdit(event.target.checked)}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-full flex flex-row justify-between items-center">
|
||||
<span>Content length limit(Byte)</span>
|
||||
<Input
|
||||
|
Reference in New Issue
Block a user