soiz1 commited on
Commit
cd2d059
·
verified ·
1 Parent(s): 8160e86

Update src/components/menu-bar/google-drive-save.jsx

Browse files
src/components/menu-bar/google-drive-save.jsx CHANGED
@@ -91,7 +91,7 @@ class GoogleDriveSave extends React.Component {
91
  this.setState({files: data.files || [], isLoading: false});
92
  } catch (error) {
93
  console.error("ファイル一覧取得エラー:", error);
94
- this.props.showAlert("error", "ファイル一覧の取得に失敗しました");
95
  this.setState({isLoading: false});
96
  }
97
  };
@@ -321,10 +321,10 @@ class GoogleDriveSave extends React.Component {
321
  handleNewFile = async () => {
322
  try {
323
  await this.saveToGoogleDrive(null, null);
324
- this.props.showAlert("success", "新規保存しました");
325
  } catch (error) {
326
  console.error("新規保存エラー:", error);
327
- this.props.showAlert("error", "新規保存に失敗しました");
328
  }
329
  };
330
 
@@ -341,11 +341,11 @@ class GoogleDriveSave extends React.Component {
341
  if (confirm(`"${project.name}"を現在のプロジェクトで上書きしますか?`)) {
342
  try {
343
  await this.saveToGoogleDrive(project.id, project.name);
344
- this.props.showAlert("success", "上書き保存しました");
345
  this.fetchDriveFiles(this.state.accessToken);
346
  } catch (error) {
347
  console.error("ファイル上書きエラー:", error);
348
- this.props.showAlert("error", "ファイルの上書きに失敗しました");
349
  }
350
  }
351
  };
@@ -370,19 +370,19 @@ class GoogleDriveSave extends React.Component {
370
  await this.deleteFile(thumbnailToDelete.id);
371
  }
372
 
373
- this.props.showAlert("success", "ファイルを削除しました");
374
  this.fetchDriveFiles(this.state.accessToken);
375
  } catch (error) {
376
  console.error("削除エラー:", error);
377
- this.props.showAlert("error", "ファイルの削除に失敗しました");
378
  }
379
  }
380
  };
381
 
382
  copyToClipboard = (text) => {
383
  navigator.clipboard.writeText(text)
384
- .then(() => this.props.showAlert("success", "リンクをクリップボードにコピーしました"))
385
- .catch(() => this.props.showAlert("error", "リンクのコピーに失敗しました"));
386
  };
387
 
388
  // API操作メソッド
 
91
  this.setState({files: data.files || [], isLoading: false});
92
  } catch (error) {
93
  console.error("ファイル一覧取得エラー:", error);
94
+ alert("error", "ファイル一覧の取得に失敗しました");
95
  this.setState({isLoading: false});
96
  }
97
  };
 
321
  handleNewFile = async () => {
322
  try {
323
  await this.saveToGoogleDrive(null, null);
324
+ alert("success", "新規保存しました");
325
  } catch (error) {
326
  console.error("新規保存エラー:", error);
327
+ alert("error", "新規保存に失敗しました");
328
  }
329
  };
330
 
 
341
  if (confirm(`"${project.name}"を現在のプロジェクトで上書きしますか?`)) {
342
  try {
343
  await this.saveToGoogleDrive(project.id, project.name);
344
+ alert("success", "上書き保存しました");
345
  this.fetchDriveFiles(this.state.accessToken);
346
  } catch (error) {
347
  console.error("ファイル上書きエラー:", error);
348
+ alert("error", "ファイルの上書きに失敗しました");
349
  }
350
  }
351
  };
 
370
  await this.deleteFile(thumbnailToDelete.id);
371
  }
372
 
373
+ alert("success", "ファイルを削除しました");
374
  this.fetchDriveFiles(this.state.accessToken);
375
  } catch (error) {
376
  console.error("削除エラー:", error);
377
+ alert("error", "ファイルの削除に失敗しました");
378
  }
379
  }
380
  };
381
 
382
  copyToClipboard = (text) => {
383
  navigator.clipboard.writeText(text)
384
+ .then(() => alert("success", "リンクをクリップボードにコピーしました"))
385
+ .catch(() => alert("error", "リンクのコピーに失敗しました"));
386
  };
387
 
388
  // API操作メソッド