Skip to content

Commit

Permalink
reinit project
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjj1024 committed Dec 19, 2024
1 parent 9749722 commit 7b267b4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pages/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ const chageTheme = async (theme: string) => {
// go project detail
const goProject = (pro: Project) => {
// if token exist, creat branch, else next page
branchName.value = pro.name
if (token.value) {
creatBranch(true)
}
store.setCurrentProject(pro)
router.push('/edit')
}
Expand Down Expand Up @@ -337,7 +342,7 @@ const getFileSha = async (filePath: string, branch: string) => {
const creatLoading = ref(false)
// creat project branch
const creatBranch = async () => {
const creatBranch = async (first: boolean = false) => {
creatLoading.value = true
token.value && (await uploadBuildYml())
// checkout branch name is english
Expand All @@ -354,6 +359,12 @@ const creatBranch = async () => {
}
)
console.log('createBranch', res)
if (first) {
console.log('first creat branch')
return
} else {
console.log('not first')
}
// 201 is ok
if (res.status === 201) {
const branchInfo: Project = {
Expand Down

0 comments on commit 7b267b4

Please sign in to comment.