ngx-hana-nameserver-history-viewer 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -758,6 +758,13 @@ function blobToFile(theBlob, fileName) {
758
758
  blob.name = fileName;
759
759
  // Cast to a File() type
760
760
  return theBlob;
761
+ }
762
+ /**
763
+ * check the object is a File object or not a File(Blob)
764
+ * @param obj
765
+ */
766
+ function isFile(obj) {
767
+ return obj && typeof obj.name === 'string';
761
768
  }
762
769
 
763
770
  class TimezoneSelectorService {
@@ -3531,9 +3538,10 @@ class NameServerHistoryComponent {
3531
3538
  }
3532
3539
  async ngOnChanges(changes) {
3533
3540
  const fbc = changes.fileBuffer;
3534
- if (fbc && fbc.currentValue && fbc.currentValue !== fbc.previousValue) {
3541
+ // !isFile(fbc.currentValue) --> only show chart when it's not a file -> it's a file, means the object has already been processed
3542
+ if (fbc && fbc.currentValue && fbc.currentValue !== fbc.previousValue && !isFile(fbc.currentValue)) {
3535
3543
  // simulate selecting file
3536
- const simulatedEvent = { target: { files: [blobToFile(this.fileBuffer, this.streamModeFileName)] } };
3544
+ const simulatedEvent = { target: { files: [blobToFile(fbc.currentValue, this.streamModeFileName)] } };
3537
3545
  await this.fileSelected(simulatedEvent);
3538
3546
  this.port = undefined; // clear the port selection
3539
3547
  if (this.autoDisplay) {