summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>2019-07-07 14:56:51 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-07-07 14:56:51 +0900
commit3b8ea90fdc9d1eec475917aac813ed34af399be7 (patch)
tree523e12059e09f3e9b7259274b5fc71a4a01053c4
parentFix: postgres redis cache の option が適用されない (#5114) (diff)
downloadmisskey-3b8ea90fdc9d1eec475917aac813ed34af399be7.tar.gz
misskey-3b8ea90fdc9d1eec475917aac813ed34af399be7.tar.bz2
misskey-3b8ea90fdc9d1eec475917aac813ed34af399be7.zip
フォルダーを削除できないときダイアログボックスで知らせる (#5111)
* フォルダーを削除できないときダイアログボックスで知らせる * https://github.com/syuilo/misskey/pull/5111#issuecomment-508959068 かわいい
-rw-r--r--locales/ja-JP.yml2
-rw-r--r--src/client/app/desktop/views/components/drive.folder.vue15
2 files changed, 17 insertions, 0 deletions
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 32a7fad398..637f2235d6 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -972,6 +972,8 @@ desktop/views/components/drive.folder.vue:
unable-to-process: "操作を完了できません"
circular-reference-detected: "移動先のフォルダーは、移動するフォルダーのサブフォルダーです。"
unhandled-error: "不明なエラー"
+ unable-to-delete: "削除できません"
+ has-child-files-or-folders: "このフォルダは空でないため、削除できません。"
contextmenu:
move-to-this-folder: "このフォルダへ移動"
show-in-new-window: "新しいウィンドウで表示"
diff --git a/src/client/app/desktop/views/components/drive.folder.vue b/src/client/app/desktop/views/components/drive.folder.vue
index fd6de5a05e..bc74ed4317 100644
--- a/src/client/app/desktop/views/components/drive.folder.vue
+++ b/src/client/app/desktop/views/components/drive.folder.vue
@@ -213,6 +213,21 @@ export default Vue.extend({
deleteFolder() {
this.$root.api('drive/folders/delete', {
folderId: this.folder.id
+ }).catch(err => {
+ switch(err.id) {
+ case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
+ this.$root.dialog({
+ type: 'error',
+ title: this.$t('unable-to-delete'),
+ text: this.$t('has-child-files-or-folders')
+ });
+ break;
+ default:
+ this.$root.dialog({
+ type: 'error',
+ text: this.$t('unable-to-delete')
+ });
+ }
});
}
}