From 62d201efdedac8b503a12c1a0601e07d489e2dd9 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Mon, 4 Dec 2023 02:15:56 +0300 Subject: [PATCH 1/2] $mol_view_tree2 refactor, https://github.com/hyoo-ru/mam_mol/pull/646 --- scout.view.ts | 2 +- suggest/suggest.view.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scout.view.ts b/scout.view.ts index 45b51f4f..7c123880 100644 --- a/scout.view.ts +++ b/scout.view.ts @@ -19,7 +19,7 @@ namespace $.$$ { @ $mol_mem data() { const text = $mol_fetch.text( 'hyoo/scout/_games.tree' ) - const json = $mol_tree.fromString( text ).sub.map( tree => tree.clone({ type : '*' }).toJSON() ) + const json = this.$.$mol_tree2_from_string( text ).kids.map( tree => this.$.$mol_tree2_to_json(tree.struct('*')) ) return json as $hyoo_scout_gist[] } diff --git a/suggest/suggest.view.ts b/suggest/suggest.view.ts index 2c748a94..6ad94ccf 100644 --- a/suggest/suggest.view.ts +++ b/suggest/suggest.view.ts @@ -40,7 +40,7 @@ namespace $.$$ { content : this.descr() , } - const gist = new $mol_tree({ type : 'game' , sub : $mol_tree.fromJSON( data ).sub }) + const gist = $mol_tree2.struct('game', $mol_tree2_from_json( data ).kids) const body = encodeURIComponent( gist.toString() + '\n' ) From 0d1d667164b71639d948bd3dd4616205e2457387 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Mon, 4 Dec 2023 10:30:34 +0300 Subject: [PATCH 2/2] $mol_view_tree2 fix kids --- scout.view.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scout.view.ts b/scout.view.ts index 7c123880..4afa2375 100644 --- a/scout.view.ts +++ b/scout.view.ts @@ -19,7 +19,7 @@ namespace $.$$ { @ $mol_mem data() { const text = $mol_fetch.text( 'hyoo/scout/_games.tree' ) - const json = this.$.$mol_tree2_from_string( text ).kids.map( tree => this.$.$mol_tree2_to_json(tree.struct('*')) ) + const json = this.$.$mol_tree2_from_string( text ).kids.map( tree => this.$.$mol_tree2_to_json(tree.struct('*', tree.kids)) ) return json as $hyoo_scout_gist[] }