Skip to content

Commit

Permalink
fix (gui, compat): data without version should be treated as latest
Browse files Browse the repository at this point in the history
  • Loading branch information
FMS-Cat committed Nov 18, 2020
1 parent c62af35 commit 54bd125
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
7 changes: 2 additions & 5 deletions packages/automaton-with-gui/src/compat/compat.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SerializedAutomatonWithGUI, defaultDataWithGUI } from '../types/SerializedAutomatonWithGUI';
import { jsonCopy } from '../utils/jsonCopy';
import { preversionCompat } from './preversionCompat';
import { v1Compat } from './v1Compat';
import { v2Compat } from './v2Compat';
import { v3Compat } from './v3Compat';
Expand All @@ -21,10 +20,8 @@ export function compat( data?: any ): SerializedAutomatonWithGUI {
let version = parseFloat( newData.version ) || parseFloat( newData.v );

if ( !version && !newData.rev ) {
newData = preversionCompat( newData );
if ( newData === null ) {
return jsonCopy( defaultDataWithGUI );
}
// assuming it's latest
return newData;
}

if ( newData.rev ) { // fuck
Expand Down
9 changes: 0 additions & 9 deletions packages/automaton-with-gui/src/compat/preversionCompat.ts

This file was deleted.

0 comments on commit 54bd125

Please sign in to comment.