Skip to content

Commit

Permalink
fix(plugin-workflow): fix locale key in storage (nocobase#4704)
Browse files Browse the repository at this point in the history
  • Loading branch information
mytharcher authored Jun 19, 2024
1 parent 2d2f1c8 commit 173dfbf
Showing 1 changed file with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* 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 React from 'react';
import React, { useCallback } from 'react';
import { Cron } from 'react-js-cron';
import { useWorkflowTranslation } from '../../locale';
import CronZhCN from './locale/Cron.zh-CN';
Expand Down Expand Up @@ -65,20 +65,24 @@ function CommonRepeatField({ value, onChange }) {

export function RepeatField({ value = null, onChange }) {
const { t } = useWorkflowTranslation();
const api = useAPIClient();
const typeValue = getRepeatTypeValue(value);
function onTypeChange(v) {
if (v === 'none') {
onChange(null);
return;
}
if (v === 'cron') {
onChange('0 * * * * *');
return;
}
onChange(v);
}
const onTypeChange = useCallback(
(v) => {
if (v === 'none') {
onChange(null);
return;
}
if (v === 'cron') {
onChange('0 * * * * *');
return;
}
onChange(v);
},
[onChange],
);

const locale = languages[localStorage.getItem('NOCOBASE_LOCALE') || 'en-US'];
const locale = languages[localStorage.getItem(api.auth.locale) || 'en-US'];

return (
<fieldset
Expand Down

0 comments on commit 173dfbf

Please sign in to comment.