Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "lowcode",
"description": "lowcode tool, support ChatGPT and other LLM",
"author": "wjkang <[email protected]>",
"version": "1.8.3",
"version": "1.8.4",
"icon": "asset/icon.png",
"publisher": "wjkang",
"repository": "https://github.com/lowcoding/lowcode-vscode",
Expand Down
2 changes: 1 addition & 1 deletion webview-react/src/components/RunScript/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const RunScript: React.FC<IProps> = (props) => {
}
} else {
props.onOk({
updateModelImmediately: true,
updateModelImmediately: false,
onlyUpdateParams: false,
model: result, // 旧版本只返回 model
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'swiper/swiper.css';
import 'viewerjs/dist/viewer.css';

export default (props: {
blockItem: Model['materials'][0];
blockItem: NonNullable<Model['materials']>[0];
onDefaultClick: () => void;
}) => {
const viewer = useRef<Viewer | undefined>();
Expand Down
1 change: 1 addition & 0 deletions webview-react/src/pages/blocks/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default () => {
<div style={{ textAlign: 'center', marginBottom: '20px' }}>
<Search
placeholder="输入关键字查询"
value={model.searchValue}
onChange={(el) => {
const { value } = el.target;
model.setSearchValue(value);
Expand Down
4 changes: 3 additions & 1 deletion webview-react/src/pages/blocks/List/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export const useModel = () => {
}[]
| undefined
>(undefined);
const [oriMaterials, setOriMaterials] = useState<typeof materials>([]);
const [oriMaterials, setOriMaterials] = useState<
NonNullable<typeof materials>
>([]);

const [selectedMaterial, setSelectedMaterial] = useState<
NonNullable<typeof materials>[0]
Expand Down
16 changes: 15 additions & 1 deletion webview-react/src/pages/blocks/List/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,23 @@ export default class Service {
typeof s.preview.img === 'string' ? [s.preview.img] : s.preview.img,
},
}));
this.model.setMaterials(list);

this.model.setOriMaterials(list);
this.model.setSelectedCategory([]);
this.model.setCategoryList(categoryList);
if (list.some((s) => s.privateMaterials)) {
const notPrivate = list.find((s) => !s.privateMaterials);
if (notPrivate) {
setTimeout(() => {
const projectName = notPrivate.name;
this.model.setSearchValue(projectName);
this.search();
}, 1000);
} else {
this.model.setMaterials(list);
}
} else {
this.model.setMaterials(list);
}
}
}