@@ -22,15 +22,22 @@ autostaple_and_autobreak_middleware(Store<AppState> store, dynamic action, NextD
2222}
2323
2424_autostaple (Store <AppState > store) async {
25- print ("autostaple, sending design to server ${constants .autostaple_url }" );
26- var response = await http.post (
27- Uri .parse (constants.autostaple_url),
28- body: json_encode (store.state.design),
29- headers: {"Content-Type" : "application/json" },
30- );
31- print ("response: ${response .body }" );
32-
33- _handle_response (store, response, "autostaple" );
25+ // ! - Commented out code was prior implementation of autostaple on a remote server
26+ // print("autostaple, sending design to server ${constants.autostaple_url}");
27+ // var response = await http.post(
28+ // Uri.parse(constants.autostaple_url),
29+ // body: json_encode(store.state.design),
30+ // headers: {"Content-Type": "application/json"},
31+ // );
32+ // print("response: ${response.body}");
33+ //
34+ // _handle_response(store, response, "autostaple");
35+ try {
36+ Design design_new = store.state.design.autostaple ();
37+ store.dispatch (actions.NewDesignSet (design_new, "autostaple" ));
38+ } catch (e) {
39+ window.alert ('Error during autostaple: ${e }' );
40+ }
3441}
3542
3643_autobreak (Store <AppState > store, actions.Autobreak action) async {
0 commit comments