Skip to content

Commit

Permalink
fix: empty store.code after changing templates (#138)
Browse files Browse the repository at this point in the history
* fix: #131 (comment)

* fix: swap data.py and main.py in text

* fix: empty store.code before hand to show loading stauts
  • Loading branch information
ydcjeff committed May 26, 2021
1 parent 7683ede commit f0d3094
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function saveConfig(key, value) {
// render the code if there are fetched files for current selected template
export function genCode() {
const currentFiles = files[store.config.template]
store.code = {}
if (currentFiles && Object.keys(currentFiles).length) {
for (const file in currentFiles) {
if (!store.config.include_test && file === 'test_all.py') {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"template-text-classification": [
"README.md",
"config.yaml",
"main.py",
"data.py",
"main.py",
"model.py",
"trainers.py",
"utils.py",
Expand Down

0 comments on commit f0d3094

Please sign in to comment.