Bug fixing

This commit is contained in:
Alexei Anoshenko 2025-08-06 16:02:39 +03:00
parent 5cb3841cf8
commit c4dfba2796
2 changed files with 8 additions and 6 deletions

View File

@ -106,12 +106,12 @@ func (app *application) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
switch req.Method {
case "POST":
case http.MethodPost:
if req.URL.Path == "/" {
app.postHandler(w, req)
}
case "GET":
case http.MethodGet:
switch req.URL.Path {
case "/":
w.WriteHeader(http.StatusOK)

View File

@ -67,7 +67,6 @@ func (listLayout *listLayoutData) init(session Session) {
listLayout.set = listLayout.setFunc
listLayout.remove = listLayout.removeFunc
listLayout.changed = listLayout.propertyChanged
}
func normalizeListLayoutTag(tag PropertyName) PropertyName {
@ -115,9 +114,12 @@ func (listLayout *listLayoutData) removeFunc(tag PropertyName) []PropertyName {
return result
case Content:
listLayout.viewsContainerData.removeFunc(Content)
listLayout.adapter = nil
return []PropertyName{Content}
result := listLayout.viewsContainerData.removeFunc(Content)
if listLayout.adapter != nil {
listLayout.adapter = nil
return []PropertyName{Content}
}
return result
}
return listLayout.viewsContainerData.removeFunc(tag)