Skip to content
Open
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 frontend/src/components/shared/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
const goToNewFile = () => {
setRepoTab({
actionName: 'new_file',
lastPath: ''
lastPath: currentPath.value.length > 0 ? '/' + currentPath.value : ''
})
}

Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/shared/NewFile.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="flex flex-col gap-4 my-[30px] md:px-5">
<div class="flex items-center gap-[10px]">
<div class="whitespace-nowrap">{{ repoName }}</div>
<div class="whitespace-nowrap">{{ repoName + repoTab.lastPath }}</div>
<div class="text-gray-500">/</div>
<el-input
v-model="fileName"
Expand Down Expand Up @@ -117,7 +117,7 @@
const createFile = async () => {
submiting.value = true
// TODO: main branch for now; should support different branches
const createFileEndpoint = `/${apiPrefixPath}/${props.namespacePath}/raw/${fileName.value}`
const createFileEndpoint = `/${apiPrefixPath}/${props.namespacePath}/raw${repoTab.lastPath}/${fileName.value}`
const bodyData = {
content: btoa_utf8(codeContent.value),
message: buildCommitMessage(),
Expand All @@ -144,7 +144,7 @@
// window.location.href = `/${prefixPath}/${props.namespacePath}/blob/${props.currentBranch}/${fileName.value}`
setRepoTab({
actionName: 'blob',
lastPath: fileName.value
lastPath: repoTab.lastPath + '/' + fileName.value
})
}

Expand Down