Skip to content

Commit d271dc5

Browse files
committed
fix: address additional CodeRabbit review comments
- Add .catch() to executeJavaScript in logging to handle promise rejection - Fix PT-BR accents: Ícone, Vídeo Chamada - Keep 'Outlook Calendar' untranslated (brand name) - Add aria-label to SearchInput for accessibility - Use i18n for entries count in log viewer - Fix type bug: has-credentials channel should return boolean, not Promise<boolean>
1 parent 4a37272 commit d271dc5

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

src/i18n/pt-BR.i18n.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
"auth": "Autenticação",
428428
"connection": "Conexão",
429429
"notification": "Notificação",
430-
"outlook": "Calendário Outlook",
430+
"outlook": "Outlook Calendar",
431431
"videoCall": "Video Chamada",
432432
"download": "Download",
433433
"spellCheck": "Verificação Ortográfica",
@@ -447,7 +447,7 @@
447447
"logViewer": {
448448
"title": "Visualizador de Logs",
449449
"aria": {
450-
"logIcon": "Icone do visualizador de logs",
450+
"logIcon": "Ícone do visualizador de logs",
451451
"entriesCount": "{{count}} entradas de log exibidas"
452452
},
453453
"fileInfo": {
@@ -500,8 +500,8 @@
500500
"main": "Processo Principal",
501501
"renderer": "Renderizador",
502502
"webview": "Webview",
503-
"videocall": "Video Chamada",
504-
"outlook": "Calendario Outlook",
503+
"videocall": "Vídeo Chamada",
504+
"outlook": "Outlook Calendar",
505505
"auth": "Autenticação",
506506
"updates": "Atualizações",
507507
"notifications": "Notificações",

src/ipc/channels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type ChannelToArgsMap = {
6060
) => Electron.DesktopCapturerSource[];
6161
'outlook-calendar/get-events': (date: Date) => OutlookEventsResponse;
6262
'outlook-calendar/set-exchange-url': (url: string, userId: string) => void;
63-
'outlook-calendar/has-credentials': () => Promise<boolean>;
63+
'outlook-calendar/has-credentials': () => boolean;
6464
'outlook-calendar/clear-credentials': () => void;
6565
'outlook-calendar/set-user-token': (token: string, userId: string) => void;
6666
'document-viewer/open-window': (

src/logViewerWindow/logViewerWindow.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ function LogViewerWindow() {
755755
</Box>
756756
<Box minWidth='x200' marginInlineEnd='x12'>
757757
<SearchInput
758+
aria-label={t('logViewer.placeholders.searchLogs')}
758759
placeholder={t('logViewer.placeholders.searchLogs')}
759760
value={searchFilter}
760761
onChange={handleSearchFilterChange}
@@ -831,7 +832,9 @@ function LogViewerWindow() {
831832
borderRadius: '4px',
832833
}}
833834
>
834-
{filteredLogs.length} entries
835+
{t('logViewer.fileInfo.entries', {
836+
count: filteredLogs.length,
837+
})}
835838
</div>
836839
<Virtuoso
837840
ref={virtuosoRef}

src/logging/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@ export const setupWebContentsLogging = () => {
255255
})();
256256
`;
257257

258-
webContents.executeJavaScript(consoleOverrideScript);
258+
webContents.executeJavaScript(consoleOverrideScript).catch((err) => {
259+
log.warn(
260+
`[logging] Failed to inject console override into webContents ${webContents.id}:`,
261+
err
262+
);
263+
});
259264
} catch (error) {
260265
logLoggingFailure(
261266
error,

src/outlookCalendar/ipc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ export const startOutlookCalendarUrlHandler = (): void => {
10091009

10101010
handle(
10111011
'outlook-calendar/has-credentials',
1012-
async (event): Promise<Promise<boolean>> => {
1012+
async (event): Promise<boolean> => {
10131013
const server = getServerInformationByWebContentsId(event.id);
10141014
if (!server) return false;
10151015
const { outlookCredentials } = server;

0 commit comments

Comments
 (0)