Closed the-ress closed 1 year ago
@the-ress I tried the repro steps in my 2.8.0-dev branch but wasn't able to reproduce the issue. That's not too surprising though, as I've done a lot of work in this area. I'm thinking of releasing a beta for 2.8.0 b/f I release it. When I post a beta, I'll at-mention you here and see if you can repro the issue.
I just tried it with current state of 2.8.0-dev
(1862d56) and I can still easily reproduce it.
~Should I rebase the fix onto the 2.8.0 branch?~
Edit: Changed target do 2.8.0-dev
I'm still not able to reproduce the issue. Here are the steps I'm performing:
https://github.com/Z-Bolt/OctoScreen/assets/10328858/bac067c0-f99b-4ff8-8956-d942b2af8e40
Wait for OctoPrint to start, and OctoScreen to connect to OctoPrint (then get taken to the Idle panel)
Click the Print button (in the Idle panel) (then get taken to the "Select source location" panel)
Click the "OctoPrint" list item (then get taken to the "Select file" panel)
Click the Back button (this takes me back to the "Select source location" panel)
Click the Back button again (this takes me back to the Idle panel)
Click the Print button again (this takes me to the "Select source location" panel)
Click the "OctoPrint" list item (then get taken to the "Select file" panel)
Click the Print icon of the first file that was listed
I'm then prompted to confirm that I want to print, and I click the Yes button
After a pause, I'm taken to the Printing panel.
The difference is I'm not getting the "Select source location" panel, pressing Print takes me right to "Select file panel" because filesPanel.sdIsReady
returns false when I don't insert the SD.
/*
* If we are at `root` (display the option for SD AND Local), but SD is not
* ready, push us up and into Local so the user doesn't have to work harder
* than they have to.
*/
if atRootLevel && !this.sdIsReady() {
atRootLevel = false
this.locationHistory = utils.LocationHistory {
Locations: []dataModels.Location{dataModels.Local},
}
}
Ahi, got it. Thanks @the-ress , and thanks for the contribution.
Fixes a crash caused by FilesPanel location history getting empty when it shouldn't.
Repro steps
OctoScreen crashes with "index out of range" at FilesPanel.go, line 444.