fix: Default display of hidden files (#9327)

#9325 
#9324
This commit is contained in:
2025-06-27 18:23:24 +08:00 committed by GitHub
parent 7889b5ad69
commit 4ef9fcde59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -753,7 +753,7 @@ const initEditor = () => {
lineNumbersMinChars: 6,
});
if (editor.getModel().getValue() === '') {
let defaultContent = '\n\n\n\n';
let defaultContent = '';
editor.getModel().setValue(defaultContent);
}

View file

@ -603,7 +603,7 @@ let selects = ref<any>([]);
const initData = () => ({
path: '/',
expand: true,
showHidden: false,
showHidden: true,
page: 1,
pageSize: 100,
search: '',
@ -718,6 +718,7 @@ const handleSearchResult = (res: ResultData<File.File>) => {
const viewHideFile = async () => {
req.showHidden = !req.showHidden;
localStorage.setItem('show-hidden', req.showHidden ? 'true' : 'false');
let searchResult = await searchFile();
handleSearchResult(searchResult);
};
@ -1411,6 +1412,10 @@ const getHostMount = async () => {
};
onMounted(() => {
if (localStorage.getItem('show-hidden') === null) {
localStorage.setItem('show-hidden', 'true');
}
req.showHidden = localStorage.getItem('show-hidden') === 'true';
getHostMount();
if (router.currentRoute.value.query.path) {
req.path = String(router.currentRoute.value.query.path);

View file

@ -246,6 +246,7 @@ const acceptParams = async (props: MoveProps) => {
addForm.name = '';
addForm.allNames = props.allNames;
type.value = props.type;
existFiles.value = [];
if (props.name && props.name != '') {
oldName.value = props.name;
const res = await checkFile(props.path + '/' + props.name, false);