mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-07 18:25:09 +00:00
[ACA-4202] - forcing firefox to ignore cache when document version ha… (#6807)
* [ACA-4202] - forcing firefox to ignore cache when document version has changed * fxed lint
This commit is contained in:
parent
318ce0e346
commit
f9a7836a5a
@ -68,6 +68,9 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
|||||||
@Input()
|
@Input()
|
||||||
thumbnailsTemplate: TemplateRef<any> = null;
|
thumbnailsTemplate: TemplateRef<any> = null;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
cacheType: string = '';
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
rendered = new EventEmitter<any>();
|
rendered = new EventEmitter<any>();
|
||||||
|
|
||||||
@ -161,6 +164,11 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
|||||||
url: urlFile.currentValue,
|
url: urlFile.currentValue,
|
||||||
withCredentials: this.appConfigService.get<boolean>('auth.withCredentials', undefined)
|
withCredentials: this.appConfigService.get<boolean>('auth.withCredentials', undefined)
|
||||||
};
|
};
|
||||||
|
if (this.cacheType) {
|
||||||
|
pdfSource.httpHeaders = {
|
||||||
|
'Cache-Control': this.cacheType
|
||||||
|
};
|
||||||
|
}
|
||||||
this.executePdf(pdfSource);
|
this.executePdf(pdfSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,6 +212,7 @@
|
|||||||
[blobFile]="blobFile"
|
[blobFile]="blobFile"
|
||||||
[urlFile]="urlFileContent"
|
[urlFile]="urlFileContent"
|
||||||
[nameFile]="displayName"
|
[nameFile]="displayName"
|
||||||
|
[cacheType]="cacheTypeForContent"
|
||||||
(error)="onUnsupportedFile()"></adf-pdf-viewer>
|
(error)="onUnsupportedFile()"></adf-pdf-viewer>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
@ -224,6 +224,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
viewerExtensions: Array<ViewerExtensionRef> = [];
|
viewerExtensions: Array<ViewerExtensionRef> = [];
|
||||||
|
|
||||||
private cacheBusterNumber;
|
private cacheBusterNumber;
|
||||||
|
cacheTypeForContent = '';
|
||||||
|
|
||||||
// Extensions that are supported by the Viewer without conversion
|
// Extensions that are supported by the Viewer without conversion
|
||||||
private extensions = {
|
private extensions = {
|
||||||
@ -278,6 +279,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
|
|
||||||
this.closeOverlayManager();
|
this.closeOverlayManager();
|
||||||
this.loadExtensions();
|
this.loadExtensions();
|
||||||
|
this.cacheTypeForContent = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
private loadExtensions() {
|
private loadExtensions() {
|
||||||
@ -299,6 +301,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
|
|
||||||
private onNodeUpdated(node: Node) {
|
private onNodeUpdated(node: Node) {
|
||||||
if (node && node.id === this.nodeId) {
|
if (node && node.id === this.nodeId) {
|
||||||
|
this.cacheTypeForContent = 'no-cache';
|
||||||
this.generateCacheBusterNumber();
|
this.generateCacheBusterNumber();
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.setUpNodeFile(node).then(() => {
|
this.setUpNodeFile(node).then(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user