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.
- package/README.md +4 -2
- package/esm2020/src/nameserver-history-viewer/components/nameserver-history.component.mjs +5 -4
- package/esm2020/src/nameserver-history-viewer/utils/file-util.mjs +8 -1
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs +10 -2
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs.map +1 -1
- package/fesm2020/ngx-hana-nameserver-history-viewer.mjs +10 -2
- package/fesm2020/ngx-hana-nameserver-history-viewer.mjs.map +1 -1
- package/package.json +1 -1
- package/src/nameserver-history-viewer/utils/file-util.d.ts +5 -0
|
@@ -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
|
-
|
|
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(
|
|
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) {
|