mirror of
https://github.com/yorukot/superfile.git
synced 2025-02-06 11:00:15 +00:00
fix: Fix UI issue of spf stuck with terminal size too small, when its actually stuck in loading files
All checks were successful
Go / build (push) Successful in 10m10s
All checks were successful
Go / build (push) Successful in 10m10s
This commit is contained in:
parent
343a69968a
commit
27ccd92ec9
@ -74,7 +74,9 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
|
||||
m.getFilePanelItems()
|
||||
|
||||
if !m.firstLoadingComplete {
|
||||
m.firstLoadingComplete = true
|
||||
}
|
||||
return m, tea.Batch(cmd)
|
||||
}
|
||||
|
||||
@ -296,6 +298,9 @@ func (m *model) warnModalForQuit() {
|
||||
|
||||
// Implement View function for bubble tea model to handle visualization.
|
||||
func (m model) View() string {
|
||||
if !m.firstLoadingComplete {
|
||||
return "Loading..."
|
||||
}
|
||||
panel := m.fileModel.filePanels[m.filePanelFocusIndex]
|
||||
// check is the terminal size enough
|
||||
if m.fullHeight < minimumHeight || m.fullWidth < minimumWidth {
|
||||
|
@ -88,6 +88,7 @@ type model struct {
|
||||
toggleDotFile bool
|
||||
updatedToggleDotFile bool
|
||||
toggleFooter bool
|
||||
firstLoadingComplete bool
|
||||
filePanelFocusIndex int
|
||||
mainPanelHeight int
|
||||
fullWidth int
|
||||
|
Loading…
x
Reference in New Issue
Block a user