File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
frontend/src/app/applications/files/services Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { escapeRegexp } from '../../../common/utils/regexp'
1818import { TAB_MENU } from '../../../layout/layout.interfaces'
1919import { LayoutService } from '../../../layout/layout.service'
2020import { StoreService } from '../../../store/store.service'
21+ import { UserType } from '../../users/interfaces/user.interface'
2122import { FileEvent } from '../interfaces/file-event.interface'
2223
2324@Injectable ( { providedIn : 'root' } )
@@ -57,11 +58,18 @@ export class FilesTasksService {
5758 msg : { success : 'Decompression done' , failed : 'Decompression failed' }
5859 }
5960 }
61+ private currentUserId : number
6062 private watcher : Subscription = null
6163 private watch = timer ( 1000 , 1000 ) . pipe ( tap ( ( ) => this . doWatch ( ) ) )
6264
6365 constructor ( ) {
64- this . loadAll ( )
66+ this . store . user . subscribe ( ( u : UserType ) => {
67+ if ( u && this . currentUserId !== u ?. id ) {
68+ // Load tasks when the user is defined and has changed to prevent interceptor redirects
69+ this . loadAll ( )
70+ }
71+ this . currentUserId = u ?. id
72+ } )
6573 }
6674
6775 addTask ( task : FileTask ) {
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ export class FilesService {
292292 } )
293293 }
294294
295- async openViewerDialog ( file : FileModel , directoryFiles : FileModel [ ] , permissions : string ) {
295+ async openViewerDialog ( file : FileModel , directoryFiles : FileModel [ ] , permissions : string ) : Promise < void > {
296296 this . http . head ( file . dataUrl ) . subscribe ( {
297297 next : async ( ) => {
298298 // This check is only used for the text viewer; other viewers are read-only or enforce permissions on the backend.
You can’t perform that action at this time.
0 commit comments