ngx-hana-nameserver-history-viewer 1.2.1-1.beta → 1.2.1-2.beta
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/esm2020/src/nameserver-history-viewer/components/nameserver-history.component.mjs +3 -4
- package/esm2020/src/nameserver-history-viewer/utils/file-util.mjs +8 -1
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs +8 -2
- package/fesm2015/ngx-hana-nameserver-history-viewer.mjs.map +1 -1
- package/fesm2020/ngx-hana-nameserver-history-viewer.mjs +8 -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,8 +3538,7 @@ class NameServerHistoryComponent {
|
|
|
3531
3538
|
}
|
|
3532
3539
|
async ngOnChanges(changes) {
|
|
3533
3540
|
const fbc = changes.fileBuffer;
|
|
3534
|
-
if (fbc && fbc.currentValue && fbc.currentValue !== fbc.previousValue) {
|
|
3535
|
-
console.log('file changed: ', fbc.currentValue, fbc.previousValue);
|
|
3541
|
+
if (fbc && fbc.currentValue && fbc.currentValue !== fbc.previousValue && !isFile(fbc.currentValue)) {
|
|
3536
3542
|
// simulate selecting file
|
|
3537
3543
|
const simulatedEvent = { target: { files: [blobToFile(fbc.currentValue, this.streamModeFileName)] } };
|
|
3538
3544
|
await this.fileSelected(simulatedEvent);
|