Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Feb 26, 2024
1 parent 7397a0a commit faeab88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
14 changes: 6 additions & 8 deletions src/app/Archives/AllArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
import { ErrorView } from '@app/ErrorView/ErrorView';
import { isAuthFail } from '@app/ErrorView/types';
import { ArchivedRecordingsTable } from '@app/Recordings/ArchivedRecordingsTable';
import { LoadingView } from '@app/Shared/Components/LoadingView';
import { ArchivedRecording, RecordingDirectory, Target, NotificationCategory } from '@app/Shared/Services/api.types';
Expand Down Expand Up @@ -50,7 +51,6 @@ import {
import * as React from 'react';
import { Observable, of } from 'rxjs';
import { getTargetFromDirectory, includesDirectory, indexOfDirectory } from './utils';
import { isAuthFail } from '@app/ErrorView/types';

const tableColumns: TableColumn[] = [
{
Expand Down Expand Up @@ -104,12 +104,10 @@ export const AllArchivedRecordingsTable: React.FC<AllArchivedRecordingsTableProp
const refreshDirectoriesAndCounts = React.useCallback(() => {
setIsLoading(true);
addSubscription(
context.api
.doGet<RecordingDirectory[]>('fs/recordings', 'beta')
.subscribe({
next: handleDirectoriesAndCounts,
error: handleError,
}),
context.api.doGet<RecordingDirectory[]>('fs/recordings', 'beta').subscribe({
next: handleDirectoriesAndCounts,
error: handleError,
}),
);
}, [addSubscription, context.api, setIsLoading, handleDirectoriesAndCounts, handleError]);

Expand Down Expand Up @@ -291,7 +289,7 @@ export const AllArchivedRecordingsTable: React.FC<AllArchivedRecordingsTableProp
<ErrorView
title={'Error retrieving archived recordings in All Archives View'}
message={errorMessage}
retry={isAuthFail(errorMessage) ? authRetry : undefined}
retry={isAuthFail(errorMessage) ? authRetry : undefined}
/>
</>
);
Expand Down
7 changes: 3 additions & 4 deletions src/app/Archives/AllTargetsArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* limitations under the License.
*/
import { ErrorView } from '@app/ErrorView/ErrorView';
import { authFailMessage } from '@app/ErrorView/types';
import { isAuthFail } from '@app/ErrorView/types';
import { authFailMessage , isAuthFail } from '@app/ErrorView/types';
import { ArchivedRecordingsTable } from '@app/Recordings/ArchivedRecordingsTable';
import { LoadingView } from '@app/Shared/Components/LoadingView';
import { Target, TargetDiscoveryEvent, NotificationCategory } from '@app/Shared/Services/api.types';
Expand Down Expand Up @@ -360,7 +359,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
{target.alias == target.connectUrl || !target.alias
? `${target.connectUrl}`
: `${target.alias} (${target.connectUrl})`}
</Td>
</Td>
<Td key={`target-table-row-${idx}_3`} dataLabel={tableColumns[1].title}>
<Badge key={`${idx}_count`}>{archiveCount}</Badge>
</Td>
Expand Down Expand Up @@ -410,7 +409,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
<ErrorView
title={'Error retrieving archived recordings in All Targets View'}
message={errorMessage}
retry={isAuthFail(errorMessage) ? authRetry : undefined}
retry={isAuthFail(errorMessage) ? authRetry : undefined}
/>
</>
);
Expand Down

0 comments on commit faeab88

Please sign in to comment.