diff --git a/src/GitHub/delete.ts b/src/GitHub/delete.ts index 8aa050d9..2f67de7c 100644 --- a/src/GitHub/delete.ts +++ b/src/GitHub/delete.ts @@ -83,21 +83,8 @@ async function deleteFromGithubOneRepo( console.warn("Rate limited exceeded, please try again later"); return {success: false, deleted: [], undeleted: []}; } - const defaultName = repo.path?.defaultName ?? settings.upload.defaultName; - const behavior = repo.path?.type ?? settings.upload.behavior; - const root = repo.path?.rootFolder ?? settings.upload.rootFolder; if (filesInRepo.length === 0) { - let errorMsg = ""; - if (defaultName.length === 0) { - errorMsg = i18next.t("deletion.defaultFolder"); - } else if ( - behavior === FolderSettings.yaml && - root.length === 0 - ) { - errorMsg = i18next.t("deletion.rootFolder"); - } - new Notice(`Error : ${errorMsg}`); - console.warn("ERROR : ", errorMsg); + console.log(`No file to delete in ${repo.owner}/${repo.repo}`); return {success: false, deleted: [], undeleted: []}; } const allSharedFiles = filesManagement.getAllFileWithPath(repoProperties.repo); diff --git a/src/settings/style.ts b/src/settings/style.ts index f5458629..4fe102c9 100644 --- a/src/settings/style.ts +++ b/src/settings/style.ts @@ -119,19 +119,19 @@ export async function folderHideShowSettings( if (value === FolderSettings.yaml) { showSettings(frontmatterKeySettings); showSettings(rootFolderSettings); - } else { - if (settings.defaultName.length > 0) { - autoCleanSetting.setDisabled(false); - if (settings.autoclean.enable) { - // @ts-ignore - autoCleanSetting.components[0].toggleEl.classList.add( - "is-enabled" - ); - } + return; + } + if (settings.defaultName.length > 0) { + autoCleanSetting.setDisabled(false); + if (settings.autoclean.enable) { + // @ts-ignore + autoCleanSetting.components[0].toggleEl.classList.add( + "is-enabled" + ); } - hideSettings(frontmatterKeySettings); - hideSettings(rootFolderSettings); } + hideSettings(frontmatterKeySettings); + hideSettings(rootFolderSettings); } /** @@ -153,12 +153,12 @@ export function autoCleanUpSettingsOnCondition( autoCleanSetting.components[0].toggleEl.classList.remove("is-enabled"); settings.autoclean.enable = false; plugin.saveSettings().then(); - } else { - autoCleanSetting.setDisabled(false); - if (settings.autoclean.enable) { - // @ts-ignore - autoCleanSetting.components[0].toggleEl.classList.add("is-enabled"); - } + return; + } + autoCleanSetting.setDisabled(false); + if (settings.autoclean.enable) { + // @ts-ignore + autoCleanSetting.components[0].toggleEl.classList.add("is-enabled"); } }