Json viewer isn't side effect free, so use a copy

This commit is contained in:
Michael Lange 2018-02-20 15:27:03 -08:00
parent 2d0a3a15ad
commit 7c27d1486b

View file

@ -1,6 +1,7 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import { run } from '@ember/runloop';
import { copy } from '@ember/object/internals';
import JSONFormatterPkg from 'npm:json-formatter-js';
// json-formatter-js is packaged in a funny way that ember-cli-browserify
@ -14,7 +15,7 @@ export default Component.extend({
expandDepth: Infinity,
formatter: computed('json', 'expandDepth', function() {
return new JSONFormatter(this.get('json'), this.get('expandDepth'), {
return new JSONFormatter(copy(this.get('json'), true), this.get('expandDepth'), {
theme: 'nomad',
});
}),