Skip to content

Commit 4e5122c

Browse files
committed
PR feedback
1 parent e99c2fc commit 4e5122c

File tree

11 files changed

+18
-20
lines changed

11 files changed

+18
-20
lines changed

packages/cloud/src/ShareService.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from "axios"
22
import * as vscode from "vscode"
33

4-
import type { ShareResponse } from "@roo-code/types"
4+
import { shareResponseSchema } from "@roo-code/types"
55
import { getRooCodeApiUrl } from "./Config"
66
import type { AuthService } from "./AuthService"
77
import type { SettingsService } from "./SettingsService"
@@ -24,10 +24,6 @@ export class ShareService {
2424
*/
2525
async shareTask(taskId: string): Promise<boolean> {
2626
try {
27-
if (!this.authService.hasActiveSession()) {
28-
return false
29-
}
30-
3127
const sessionToken = this.authService.getSessionToken()
3228
if (!sessionToken) {
3329
return false
@@ -45,7 +41,7 @@ export class ShareService {
4541
},
4642
)
4743

48-
const data = response.data as ShareResponse
44+
const data = shareResponseSchema.parse(response.data)
4945
this.log("[share] Share link created successfully:", data)
5046

5147
if (data.success && data.shareUrl) {

packages/types/src/cloud.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ export const ORGANIZATION_DEFAULT: OrganizationSettings = {
109109
* Share Types
110110
*/
111111

112-
export interface ShareResponse {
113-
success: boolean
114-
shareUrl?: string
115-
error?: string
116-
}
112+
export const shareResponseSchema = z.object({
113+
success: z.boolean(),
114+
shareUrl: z.string().optional(),
115+
error: z.string().optional(),
116+
})
117+
118+
export type ShareResponse = z.infer<typeof shareResponseSchema>

src/i18n/locales/ca/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"custom_storage_path_set": "Ruta d'emmagatzematge personalitzada establerta: {{path}}",
8383
"default_storage_path": "S'ha reprès l'ús de la ruta d'emmagatzematge predeterminada",
8484
"settings_imported": "Configuració importada correctament.",
85-
"share_link_copied": "Enllaç de compartició copiat al portapapers!"
85+
"share_link_copied": "Enllaç de compartició copiat al portapapers"
8686
},
8787
"answers": {
8888
"yes": "",

src/i18n/locales/de/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "Benutzerdefinierter Speicherpfad festgelegt: {{path}}",
7979
"default_storage_path": "Auf Standardspeicherpfad zurückgesetzt",
8080
"settings_imported": "Einstellungen erfolgreich importiert.",
81-
"share_link_copied": "Share-Link in die Zwischenablage kopiert!"
81+
"share_link_copied": "Share-Link in die Zwischenablage kopiert"
8282
},
8383
"answers": {
8484
"yes": "Ja",

src/i18n/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "Custom storage path set: {{path}}",
7979
"default_storage_path": "Reverted to using default storage path",
8080
"settings_imported": "Settings imported successfully.",
81-
"share_link_copied": "Share link copied to clipboard!"
81+
"share_link_copied": "Share link copied to clipboard"
8282
},
8383
"answers": {
8484
"yes": "Yes",

src/i18n/locales/es/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "Ruta de almacenamiento personalizada establecida: {{path}}",
7979
"default_storage_path": "Se ha vuelto a usar la ruta de almacenamiento predeterminada",
8080
"settings_imported": "Configuración importada correctamente.",
81-
"share_link_copied": "¡Enlace de compartir copiado al portapapeles!"
81+
"share_link_copied": "Enlace de compartir copiado al portapapeles"
8282
},
8383
"answers": {
8484
"yes": "",

src/i18n/locales/fr/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "Chemin de stockage personnalisé défini : {{path}}",
7979
"default_storage_path": "Retour au chemin de stockage par défaut",
8080
"settings_imported": "Paramètres importés avec succès.",
81-
"share_link_copied": "Lien de partage copié dans le presse-papiers !"
81+
"share_link_copied": "Lien de partage copié dans le presse-papiers"
8282
},
8383
"answers": {
8484
"yes": "Oui",

src/i18n/locales/hi/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "कस्टम स्टोरेज पाथ सेट किया गया: {{path}}",
7979
"default_storage_path": "डिफ़ॉल्ट स्टोरेज पाथ का उपयोग पुनः शुरू किया गया",
8080
"settings_imported": "सेटिंग्स सफलतापूर्वक इम्पोर्ट की गईं।",
81-
"share_link_copied": "साझा लिंक क्लिपबोर्ड पर कॉपी किया गया!"
81+
"share_link_copied": "साझा लिंक क्लिपबोर्ड पर कॉपी किया गया"
8282
},
8383
"answers": {
8484
"yes": "हां",

src/i18n/locales/it/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "Percorso di archiviazione personalizzato impostato: {{path}}",
7979
"default_storage_path": "Tornato al percorso di archiviazione predefinito",
8080
"settings_imported": "Impostazioni importate con successo.",
81-
"share_link_copied": "Link di condivisione copiato negli appunti!"
81+
"share_link_copied": "Link di condivisione copiato negli appunti"
8282
},
8383
"answers": {
8484
"yes": "",

src/i18n/locales/zh-CN/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"custom_storage_path_set": "自定义存储路径已设置:{{path}}",
7979
"default_storage_path": "已恢复使用默认存储路径",
8080
"settings_imported": "设置已成功导入。",
81-
"share_link_copied": "分享链接已复制到剪贴板"
81+
"share_link_copied": "分享链接已复制到剪贴板"
8282
},
8383
"answers": {
8484
"yes": "",

0 commit comments

Comments
 (0)