mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 19:30:17 +08:00
fix(MessageMenubar): add "copy plain text" control (#7261)
* fix(MessageMenubar): add "copy plain text" control * fix(migrate): add default plain_text export option in v114
This commit is contained in:
parent
d02fbf9d8f
commit
96856eb943
@ -1104,7 +1104,8 @@
|
||||
"obsidian": "Export to Obsidian",
|
||||
"siyuan": "Export to SiYuan Note",
|
||||
"joplin": "Export to Joplin",
|
||||
"docx": "Export as Word"
|
||||
"docx": "Export as Word",
|
||||
"plain_text": "Copy as Plain Text"
|
||||
},
|
||||
"joplin": {
|
||||
"check": {
|
||||
|
||||
@ -1102,7 +1102,8 @@
|
||||
"obsidian": "Obsidianにエクスポート",
|
||||
"siyuan": "思源ノートにエクスポート",
|
||||
"joplin": "Joplinにエクスポート",
|
||||
"docx": "Wordとしてエクスポート"
|
||||
"docx": "Wordとしてエクスポート",
|
||||
"plain_text": "プレーンテキストとしてコピー"
|
||||
},
|
||||
"joplin": {
|
||||
"check": {
|
||||
|
||||
@ -1101,7 +1101,8 @@
|
||||
"obsidian": "Экспорт в Obsidian",
|
||||
"siyuan": "Экспорт в SiYuan Note",
|
||||
"joplin": "Экспорт в Joplin",
|
||||
"docx": "Экспорт в Word"
|
||||
"docx": "Экспорт в Word",
|
||||
"plain_text": "Копировать как чистый текст"
|
||||
},
|
||||
"joplin": {
|
||||
"check": {
|
||||
|
||||
@ -1104,7 +1104,8 @@
|
||||
"obsidian": "导出到Obsidian",
|
||||
"siyuan": "导出到思源笔记",
|
||||
"joplin": "导出到Joplin",
|
||||
"docx": "导出为Word"
|
||||
"docx": "导出为Word",
|
||||
"plain_text": "复制为纯文本"
|
||||
},
|
||||
"joplin": {
|
||||
"check": {
|
||||
|
||||
@ -1104,7 +1104,8 @@
|
||||
"obsidian": "匯出到Obsidian",
|
||||
"siyuan": "匯出到思源筆記",
|
||||
"joplin": "匯出到Joplin",
|
||||
"docx": "匯出為Word"
|
||||
"docx": "匯出為Word",
|
||||
"plain_text": "複製為純文本"
|
||||
},
|
||||
"joplin": {
|
||||
"check": {
|
||||
|
||||
@ -205,7 +205,7 @@ const MessageMenubar: FC<Props> = (props) => {
|
||||
key: 'export',
|
||||
icon: <Share size={16} color="var(--color-icon)" style={{ marginTop: 3 }} />,
|
||||
children: [
|
||||
{
|
||||
exportMenuOptions.plain_text && {
|
||||
label: t('chat.topics.copy.plain_text'),
|
||||
key: 'copy_message_plain_text',
|
||||
onClick: () => copyMessageAsPlainText(message)
|
||||
|
||||
@ -84,6 +84,16 @@ const ExportMenuOptions: FC = () => {
|
||||
<SettingRowTitle>{t('settings.data.export_menu.docx')}</SettingRowTitle>
|
||||
<Switch checked={exportMenuOptions.docx} onChange={(checked) => handleToggleOption('docx', checked)} />
|
||||
</SettingRow>
|
||||
|
||||
<SettingDivider />
|
||||
|
||||
<SettingRow>
|
||||
<SettingRowTitle>{t('settings.data.export_menu.plain_text')}</SettingRowTitle>
|
||||
<Switch
|
||||
checked={exportMenuOptions.plain_text}
|
||||
onChange={(checked) => handleToggleOption('plain_text', checked)}
|
||||
/>
|
||||
</SettingRow>
|
||||
</SettingGroup>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1596,6 +1596,18 @@ const migrateConfig = {
|
||||
} catch (error) {
|
||||
return state
|
||||
}
|
||||
},
|
||||
'114': (state: RootState) => {
|
||||
try {
|
||||
if (state.settings && state.settings.exportMenuOptions) {
|
||||
if (typeof state.settings.exportMenuOptions.plain_text === 'undefined') {
|
||||
state.settings.exportMenuOptions.plain_text = true
|
||||
}
|
||||
}
|
||||
return state
|
||||
} catch (error) {
|
||||
return state
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -167,6 +167,7 @@ export interface SettingsState {
|
||||
obsidian: boolean
|
||||
siyuan: boolean
|
||||
docx: boolean
|
||||
plain_text: boolean
|
||||
}
|
||||
// OpenAI
|
||||
openAI: {
|
||||
@ -308,7 +309,8 @@ export const initialState: SettingsState = {
|
||||
joplin: true,
|
||||
obsidian: true,
|
||||
siyuan: true,
|
||||
docx: true
|
||||
docx: true,
|
||||
plain_text: true
|
||||
},
|
||||
// OpenAI
|
||||
openAI: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user