Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Feb 26, 2024
1 parent 9941465 commit 57ece44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/app/Archives/AllArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { ErrorView } from '@app/ErrorView/ErrorView';
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 { ArchivedRecording, RecordingDirectory, Target, NotificationCategory } from '@app/Shared/Services/api.types';
Expand Down Expand Up @@ -148,6 +148,14 @@ export const AllArchivedRecordingsTable: React.FC<AllArchivedRecordingsTableProp
);
}, [directories, searchText, sortBy]);

React.useEffect(() => {
addSubscription(
context.target.authFailure().subscribe(() => {
setErrorMessage(authFailMessage);
}),
);
}, [context, context.target, setErrorMessage, addSubscription]);

React.useEffect(() => {
if (!context.settings.autoRefreshEnabled()) {
return;
Expand Down
3 changes: 2 additions & 1 deletion src/app/Archives/AllTargetsArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
(targetNodes: any[]) => {
setIsLoading(false);
setErrorMessage('');
setArchivesForTargets(
targetNodes.map((node) => {
const target: Target = {
Expand All @@ -122,7 +123,7 @@ export const AllTargetsArchivedRecordingsTable: React.FC<AllTargetsArchivedRecor
}),
);
},
[setArchivesForTargets, setIsLoading],
[setArchivesForTargets, setIsLoading, setErrorMessage],
);

const handleError = React.useCallback(
Expand Down

0 comments on commit 57ece44

Please sign in to comment.