フォルダーを削除できないときダイアログボックスで知らせる (#5111)
* フォルダーを削除できないときダイアログボックスで知らせる * https://github.com/syuilo/misskey/pull/5111#issuecomment-508959068 かわいい
This commit is contained in:
		
							parent
							
								
									638458e2c1
								
							
						
					
					
						commit
						3b8ea90fdc
					
				
					 2 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
					@ -972,6 +972,8 @@ desktop/views/components/drive.folder.vue:
 | 
				
			||||||
  unable-to-process: "操作を完了できません"
 | 
					  unable-to-process: "操作を完了できません"
 | 
				
			||||||
  circular-reference-detected: "移動先のフォルダーは、移動するフォルダーのサブフォルダーです。"
 | 
					  circular-reference-detected: "移動先のフォルダーは、移動するフォルダーのサブフォルダーです。"
 | 
				
			||||||
  unhandled-error: "不明なエラー"
 | 
					  unhandled-error: "不明なエラー"
 | 
				
			||||||
 | 
					  unable-to-delete: "削除できません"
 | 
				
			||||||
 | 
					  has-child-files-or-folders: "このフォルダは空でないため、削除できません。"
 | 
				
			||||||
  contextmenu:
 | 
					  contextmenu:
 | 
				
			||||||
    move-to-this-folder: "このフォルダへ移動"
 | 
					    move-to-this-folder: "このフォルダへ移動"
 | 
				
			||||||
    show-in-new-window: "新しいウィンドウで表示"
 | 
					    show-in-new-window: "新しいウィンドウで表示"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,6 +213,21 @@ export default Vue.extend({
 | 
				
			||||||
		deleteFolder() {
 | 
							deleteFolder() {
 | 
				
			||||||
			this.$root.api('drive/folders/delete', {
 | 
								this.$root.api('drive/folders/delete', {
 | 
				
			||||||
				folderId: this.folder.id
 | 
									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')
 | 
				
			||||||
 | 
											});
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue