Skip to content

Commit

Permalink
fix losing the configuration when the UI is exited before it has full…
Browse files Browse the repository at this point in the history
…y loaded
  • Loading branch information
tlarsendataguy committed May 10, 2021
1 parent 88ee0dd commit 1df1911
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 35 deletions.
5 changes: 3 additions & 2 deletions flutter/input/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Future<ByteData> fontFileToByteData(List<int> file) async {
}

void main() async {
var appState = AppState(configuration);
registerSaveConfigCallback(appState.getConfig);

var monoLoader = FontLoader("JetBrains Mono");
monoLoader.addFont(fontFileToByteData(monoFontFile));
var monoFuture = monoLoader.load();
Expand All @@ -25,8 +28,6 @@ void main() async {
await monoFuture;
await materialFuture;

var appState = AppState(configuration);
registerSaveConfigCallback(appState.getConfig);
runApp(BlocProvider<AppState>(
child: Neo4jInputApp(),
bloc: appState,
Expand Down
8 changes: 6 additions & 2 deletions flutter/input/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@
window.Alteryx.JsEvent(JSON.stringify({Event: 'SetConfiguration'}))
},
GetConfiguration: function() {
var config = window.customToolConfig;
if (window.getCustomToolConfig != null) {
config = window.getCustomToolConfig();
}
window.Alteryx.JsEvent(JSON.stringify({
Event: 'GetConfiguration',
Configuration: {
Configuration: {JSON: window.getCustomToolConfig()},
Configuration: {JSON: config},
Annotation: ''
}
}))
}));
}
}
</script>
Expand Down
5 changes: 3 additions & 2 deletions flutter/output/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ List<String> lazyLoadIncomingFields(){
}

void main() async {
var appState = decodeConfig(configuration, lazyLoadIncomingFields);
registerSaveConfigCallback(appState.getConfig);

var materialLoader = FontLoader("MaterialIcons");
materialLoader.addFont(fontFileToByteData(materialIcons));
await materialLoader.load();

var appState = decodeConfig(configuration, lazyLoadIncomingFields);
registerSaveConfigCallback(appState.getConfig);
runApp(BlocProvider<Configuration>(
child: MyApp(),
bloc: appState,
Expand Down
6 changes: 5 additions & 1 deletion flutter/output/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@
window.Alteryx.JsEvent(JSON.stringify({Event: 'SetConfiguration'}));
},
GetConfiguration: function () {
var config = window.customToolConfig;
if (window.getCustomToolConfig != null) {
config = window.getCustomToolConfig();
}
window.Alteryx.JsEvent(JSON.stringify({
Event: 'GetConfiguration',
Configuration: {
Configuration: {JSON: window.getCustomToolConfig()},
Configuration: {JSON: config},
Annotation: ''
}
}));
Expand Down
8 changes: 6 additions & 2 deletions go/input/Neo4jInput/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@
window.Alteryx.JsEvent(JSON.stringify({Event: 'SetConfiguration'}))
},
GetConfiguration: function() {
var config = window.customToolConfig;
if (window.getCustomToolConfig != null) {
config = window.getCustomToolConfig();
}
window.Alteryx.JsEvent(JSON.stringify({
Event: 'GetConfiguration',
Configuration: {
Configuration: {JSON: window.getCustomToolConfig()},
Configuration: {JSON: config},
Annotation: ''
}
}))
}));
}
}
</script>
Expand Down
36 changes: 18 additions & 18 deletions go/input/Neo4jInput/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -16643,31 +16643,31 @@ case 1:return P.ac(q,r)}})
return P.ad($async$a9j,r)},
O4:function(){var s=0,r=P.ae(t.z),q,p,o,n,m,l,k,j,i,h,g
var $async$O4=P.a8(function(a,b){if(a===1)return P.ab(b,r)
while(true)switch(s){case 0:h=t.ty
g=new O.CM("JetBrains Mono",H.c([],h))
g.Iy(F.a9j($.avA))
q=g.ph(0)
p=new O.CM("MaterialIcons",H.c([],h))
p.Iy(F.a9j($.avy))
o=p.ph(0)
while(true)switch(s){case 0:h=new T.nx()
g=h.a=Q.auV(self.customToolConfig)
h.b=U.aay(g.f,t.bj)
h.c=U.aay(g.r,t.nb)
window.getCustomToolConfig=P.jM(h.gMF())
g=t.ty
q=new O.CM("JetBrains Mono",H.c([],g))
q.Iy(F.a9j($.avA))
p=q.ph(0)
o=new O.CM("MaterialIcons",H.c([],g))
o.Iy(F.a9j($.avy))
n=o.ph(0)
s=2
return P.aa(q,$async$O4)
return P.aa(p,$async$O4)
case 2:s=3
return P.aa(o,$async$O4)
case 3:n=new T.nx()
h=n.a=Q.auV(self.customToolConfig)
n.b=U.aay(h.f,t.bj)
n.c=U.aay(h.r,t.nb)
window.getCustomToolConfig=P.jM(n.gMF())
if($.ba==null){h=H.c([],t.GA)
return P.aa(n,$async$O4)
case 3:if($.ba==null){g=H.c([],t.GA)
m=$.Y
l=H.c([],t.Jh)
k=P.b8(7,null,!1,t.JI)
j=t.S
i=t.j1
new N.Hq(null,h,!0,new P.aN(new P.Z(m,t.U),t.T),!1,null,!1,!1,null,$,null,!1,0,!1,$,null,new N.Me(P.aW(t.M)),$,$,l,null,N.auC(),new Y.CV(N.auB(),k,t.G7),!1,0,P.x(j,t.h1),P.be(j),H.c([],i),H.c([],i),null,!1,C.ff,!0,!1,null,C.H,C.H,null,0,null,!1,P.kk(null,t.qL),new O.WL(P.x(j,t.rr),P.x(t.Ld,t.iD)),new D.T6(P.x(j,t.cK)),new G.WO(),P.x(j,t.Fn),$,!1,C.y5).RG()}h=$.ba
h.Na(new Y.iv(new F.DR(null),n,null,t.iM))
h.Cg()
new N.Hq(null,g,!0,new P.aN(new P.Z(m,t.U),t.T),!1,null,!1,!1,null,$,null,!1,0,!1,$,null,new N.Me(P.aW(t.M)),$,$,l,null,N.auC(),new Y.CV(N.auB(),k,t.G7),!1,0,P.x(j,t.h1),P.be(j),H.c([],i),H.c([],i),null,!1,C.ff,!0,!1,null,C.H,C.H,null,0,null,!1,P.kk(null,t.qL),new O.WL(P.x(j,t.rr),P.x(t.Ld,t.iD)),new D.T6(P.x(j,t.cK)),new G.WO(),P.x(j,t.Fn),$,!1,C.y5).RG()}g=$.ba
g.Na(new Y.iv(new F.DR(null),h,null,t.iM))
g.Cg()
return P.ac(null,r)}})
return P.ad($async$O4,r)},
DR:function DR(a){this.a=a},
Expand Down
6 changes: 5 additions & 1 deletion go/output/Neo4jOutput/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@
window.Alteryx.JsEvent(JSON.stringify({Event: 'SetConfiguration'}));
},
GetConfiguration: function () {
var config = window.customToolConfig;
if (window.getCustomToolConfig != null) {
config = window.getCustomToolConfig();
}
window.Alteryx.JsEvent(JSON.stringify({
Event: 'GetConfiguration',
Configuration: {
Configuration: {JSON: window.getCustomToolConfig()},
Configuration: {JSON: config},
Annotation: ''
}
}));
Expand Down
14 changes: 7 additions & 7 deletions go/output/Neo4jOutput/main.dart.js
Original file line number Diff line number Diff line change
Expand Up @@ -15529,20 +15529,20 @@ if(J.d(q.gB6(r),"Blob")||J.d(q.gB6(r),"SpatialObj"))continue
p.push(q.gLF(r))}return p},
a5g:function(){var s=0,r=P.ad(t.z),q,p,o,n,m,l,k,j
var $async$a5g=P.a8(function(a,b){if(a===1)return P.aa(b,r)
while(true)switch(s){case 0:j=new O.Q3("MaterialIcons",H.b([],t.ad))
j.Zr(F.a7Q($.apo))
while(true)switch(s){case 0:j=Q.aoR(self.customToolConfig,F.apm())
window.getCustomToolConfig=P.j0(j.gKl())
q=new O.Q3("MaterialIcons",H.b([],t.ad))
q.Zr(F.a7Q($.apo))
s=2
return P.af(j.t_(0),$async$a5g)
case 2:q=Q.aoR(self.customToolConfig,F.apm())
window.getCustomToolConfig=P.j0(q.gKl())
if($.b2==null){p=H.b([],t.kf)
return P.af(q.t_(0),$async$a5g)
case 2:if($.b2==null){p=H.b([],t.kf)
o=$.a_
n=H.b([],t.kC)
m=P.bk(7,null,!1,t.tI)
l=t.S
k=t.u3
new N.Fw(null,p,!0,new P.aL(new P.a2(o,t.U),t.T),!1,null,!1,!1,null,$,null,!1,0,!1,$,null,new N.K3(P.aV(t.M)),$,$,n,null,N.aoF(),new Y.Bx(N.aoE(),m,t.f7),!1,0,P.x(l,t.b1),P.bd(l),H.b([],k),H.b([],k),null,!1,C.f7,!0,!1,null,C.A,C.A,null,0,null,!1,P.jB(null,t.cL),new O.TB(P.x(l,t.p6),P.x(t.yd,t.rY)),new D.Qr(P.x(l,t.eK)),new G.TE(),P.x(l,t.ln),$,!1,C.xl).Pc()}p=$.b2
p.KO(new Y.ky(new F.Ch(null),q,null,t.k1))
p.KO(new Y.ky(new F.Ch(null),j,null,t.k1))
p.Aw()
return P.ab(null,r)}})
return P.ac($async$a5g,r)},
Expand Down

0 comments on commit 1df1911

Please sign in to comment.