public ngOnChanges()

in desktop/src/@batch-flask/ui/file/file-viewer/file-viewer-container/file-viewer-container.component.ts [63:99]


    public ngOnChanges(inputs) {
        if (inputs.fileLoader) {
            this.filename = this.fileLoader && this.fileLoader.displayName;

            this._findFileType();
            this._clearPropertiesSub();
            this._propertiesSub = this.fileLoader.properties.subscribe({
                next: (file: File | ServerError) => {
                    if (file instanceof File) {
                        this.fileNotFound = false;
                        this.forbidden = false;

                        this.file = file;

                        if (this.componentType
                            && this.componentType.MAX_FILE_SIZE
                            && file.properties.contentLength > this.componentType.MAX_FILE_SIZE) {
                            this.fileTooLarge = true;
                            this._clearViewer();
                        } else {
                            this.fileTooLarge = false;
                            this._computeViewer();
                        }
                        this.changeDetector.markForCheck();
                    } else {
                        this._handleError(file);
                    }
                },
            });
        }

        if (inputs.config) {
            this.fileAssociationService = this.fileAssociationService.withLocalAssociations(
                this.config.fileAssociations || []);
            this._findFileType();
        }
    }