fix zbuf error (#154)

Add an optional extended description…
This commit is contained in:
William
2017-10-10 10:59:44 +00:00
committed by Noah Stride
parent e53c04a07f
commit 65998778fe
2 changed files with 3 additions and 2 deletions

View File

@@ -97,6 +97,7 @@
"fbemitter": "^2.1.1",
"lodash": "^4.17.4",
"lz-string": "^1.4.4",
"pako": "^1.0.6",
"prop-types": "^15.5.8",
"react": "^15.5.4",
"react-dom": "^15.5.4",

View File

@@ -20,7 +20,7 @@ import ComparisonPage from './pages/ComparisonPage';
import ShipyardPage from './pages/ShipyardPage';
import ErrorDetails from './pages/ErrorDetails';
const zlib = require('zlib');
const zlib = require('pako');
/**
* Coriolis App
@@ -90,7 +90,7 @@ export default class Coriolis extends React.Component {
_importBuild(r) {
try {
// Need to decode and gunzip the data, then build the ship
const data = zlib.gunzipSync(new Buffer(r.params.data, 'base64'));
const data = zlib.inflate(new Buffer(r.params.data, 'base64'), { to: 'string' });
const json = JSON.parse(data);
const ship = CompanionApiUtils.shipFromJson(json);
r.params.ship = ship.id;