@@ -817,8 +817,8 @@ func (m *SnapshotEndpointInput) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
817
817
if done {
818
818
m .state .snapshotEndpoint = input .Text
819
819
m .state .weave .PreviousResponse += styles .RenderPreviousResponse (styles .DotsSeparator , m .GetQuestion (), []string {"snapshot url" }, input .Text )
820
- // TODO: Continue
821
- return m , tea . Quit
820
+ snapshotDownload := NewSnapshotDownloadLoading ( m . state )
821
+ return snapshotDownload , snapshotDownload . Init ()
822
822
}
823
823
m .TextInput = input
824
824
return m , cmd
@@ -867,3 +867,36 @@ func (m *StateSyncEndpointInput) View() string {
867
867
// TODO: Correctly render terminal output
868
868
return m .state .weave .PreviousResponse + styles .RenderPrompt (m .GetQuestion (), []string {"state sync RPC" }, styles .Question ) + m .TextInput .View ()
869
869
}
870
+
871
+ type SnapshotDownloadLoading struct {
872
+ utils.Loading
873
+ state * RunL1NodeState
874
+ }
875
+
876
+ func NewSnapshotDownloadLoading (state * RunL1NodeState ) * SnapshotDownloadLoading {
877
+ return & SnapshotDownloadLoading {
878
+ Loading : utils .NewLoading ("Downloading snapshot from the provided URL..." , utils .DefaultWait ()),
879
+ state : state ,
880
+ }
881
+ }
882
+
883
+ func (m * SnapshotDownloadLoading ) Init () tea.Cmd {
884
+ return m .Loading .Init ()
885
+ }
886
+
887
+ func (m * SnapshotDownloadLoading ) Update (msg tea.Msg ) (tea.Model , tea.Cmd ) {
888
+ loader , cmd := m .Loading .Update (msg )
889
+ m .Loading = loader
890
+ if m .Loading .Completing {
891
+ m .state .weave .PreviousResponse += styles .RenderPreviousResponse (styles .NoSeparator , "Snapshot downloaded successfully." , []string {}, "" )
892
+ return m , tea .Quit
893
+ }
894
+ return m , cmd
895
+ }
896
+
897
+ func (m * SnapshotDownloadLoading ) View () string {
898
+ if m .Completing {
899
+ return m .state .weave .PreviousResponse
900
+ }
901
+ return m .state .weave .PreviousResponse + m .Loading .View ()
902
+ }
0 commit comments