Skip to content

Commit

Permalink
fix: use temp variable (#1)
Browse files Browse the repository at this point in the history
* fix: replace empty pic link

* fix: img url

* fix: use temp

---------

Co-authored-by: wangbo <[email protected]>
  • Loading branch information
Niko030303 and boris-w authored Feb 9, 2023
1 parent da1649e commit e868f62
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 61,498 deletions.
61,490 changes: 0 additions & 61,490 deletions dist/packed/widget_bundle.js

This file was deleted.

2 changes: 2 additions & 0 deletions dist/packed/widget_bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/chart/empty_content/empty_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function defaultEmptyContent(props: EmptyContentProps) {
>
<img
alt="empty-image"
src="../../../img/empty.png"
src="https://legacy-s1.apitable.com/space/2022/02/16/7f9dca59465c4ac8be91dbbf1ab4abad"
style={{
width: 160,
height: 120,
Expand Down
11 changes: 6 additions & 5 deletions src/components/setting/fieldItem/fieldItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export const FieldItem: React.FC<IFieldItem> = (props) => {
const number_fields = getNumFields(viewId);

const changeHandler = (option) => {
dimensionFieldIds.splice(i, 1, option.value);
let tempDimensionFieldIds = [...dimensionFieldIds]
tempDimensionFieldIds.splice(i, 1, option.value);
// // TODO: Subsequent sorting function development modify this function
// switch (mode) {
// case "2":
Expand All @@ -42,8 +43,7 @@ export const FieldItem: React.FC<IFieldItem> = (props) => {
// );
// break;
// }

setConfig(config);
setConfig({ ...config, dimensionFieldIds: tempDimensionFieldIds });
};

return isSettingOpened ? (
Expand Down Expand Up @@ -75,8 +75,9 @@ export const FieldItem: React.FC<IFieldItem> = (props) => {
size="small"
className={"dragHandler"}
onClick={() => {
config.dimensionFieldIds.splice(i, 1);
setConfig({ ...config, dimensionFieldIds });
let tempDimensionFieldIds = [...config.dimensionFieldIds]
tempDimensionFieldIds.splice(i, 1);
setConfig({ ...config, dimensionFieldIds: tempDimensionFieldIds });
}}
/>
</IconWrap>
Expand Down
5 changes: 3 additions & 2 deletions src/components/setting/setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ export const Setting: React.FC<ISettingProps> = (props) => {
console.error("No empty position");
return;
}
dimensionFieldIds.push(number_fields[first_one].id);
setConfig(config);
let tempDimensionFieldIds = [...dimensionFieldIds]
tempDimensionFieldIds.push(number_fields[first_one].id);
setConfig({ ...config, dimensionFieldIds: tempDimensionFieldIds });
};

return (
Expand Down
Binary file removed src/img/empty.png
Binary file not shown.

0 comments on commit e868f62

Please sign in to comment.