mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 12:56:13 +00:00
fix(plugin-workflow): fix locale key in storage (#4704)
This commit is contained in:
parent
2d2f1c8cc8
commit
173dfbfe21
@ -7,9 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { css } from '@nocobase/client';
|
import { css, useAPIClient } from '@nocobase/client';
|
||||||
import { InputNumber, Select } from 'antd';
|
import { InputNumber, Select } from 'antd';
|
||||||
import React from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { Cron } from 'react-js-cron';
|
import { Cron } from 'react-js-cron';
|
||||||
import { useWorkflowTranslation } from '../../locale';
|
import { useWorkflowTranslation } from '../../locale';
|
||||||
import CronZhCN from './locale/Cron.zh-CN';
|
import CronZhCN from './locale/Cron.zh-CN';
|
||||||
@ -65,8 +65,10 @@ function CommonRepeatField({ value, onChange }) {
|
|||||||
|
|
||||||
export function RepeatField({ value = null, onChange }) {
|
export function RepeatField({ value = null, onChange }) {
|
||||||
const { t } = useWorkflowTranslation();
|
const { t } = useWorkflowTranslation();
|
||||||
|
const api = useAPIClient();
|
||||||
const typeValue = getRepeatTypeValue(value);
|
const typeValue = getRepeatTypeValue(value);
|
||||||
function onTypeChange(v) {
|
const onTypeChange = useCallback(
|
||||||
|
(v) => {
|
||||||
if (v === 'none') {
|
if (v === 'none') {
|
||||||
onChange(null);
|
onChange(null);
|
||||||
return;
|
return;
|
||||||
@ -76,9 +78,11 @@ export function RepeatField({ value = null, onChange }) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
onChange(v);
|
onChange(v);
|
||||||
}
|
},
|
||||||
|
[onChange],
|
||||||
|
);
|
||||||
|
|
||||||
const locale = languages[localStorage.getItem('NOCOBASE_LOCALE') || 'en-US'];
|
const locale = languages[localStorage.getItem(api.auth.locale) || 'en-US'];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<fieldset
|
<fieldset
|
||||||
|
Loading…
Reference in New Issue
Block a user