Update sshKeys.store.ts
This commit is contained in:
@@ -60,13 +60,12 @@ export const useSshKeysStore = defineStore('sshKeys', () => {
|
||||
sshKeys.value.push(response.data.key);
|
||||
// Sort keys by name
|
||||
sshKeys.value.sort((a, b) => a.name.localeCompare(b.name));
|
||||
uiNotificationsStore.showSuccess(response.data.message || 'SSH 密钥添加成功。'); // 使用便捷方法,默认 3 秒超时
|
||||
return true;
|
||||
} catch (err: any) {
|
||||
console.error('Failed to add SSH key:', err);
|
||||
error.value = err.response?.data?.message || err.message || '添加 SSH 密钥失败。';
|
||||
// Ensure error.value is not null before passing
|
||||
uiNotificationsStore.showError(error.value ?? '未知错误'); // 使用便捷方法,默认 5 秒超时
|
||||
// uiNotificationsStore.showError(error.value ?? '未知错误'); // 使用便捷方法,默认 5 秒超时 // Removed notification
|
||||
return false;
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user