mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-26 06:22:50 -05:00
matugen: fix adw-gtk3 setting in light mode
- and add models.Get/GetOr helpers
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleInstall(conn net.Conn, req models.Request) {
|
||||
idOrName, ok := req.Params["name"].(string)
|
||||
idOrName, ok := models.Get[string](req, "name")
|
||||
if !ok {
|
||||
models.RespondError(conn, req.ID, "missing or invalid 'name' parameter")
|
||||
return
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleSearch(conn net.Conn, req models.Request) {
|
||||
query, ok := req.Params["query"].(string)
|
||||
query, ok := models.Get[string](req, "query")
|
||||
if !ok {
|
||||
models.RespondError(conn, req.ID, "missing or invalid 'query' parameter")
|
||||
return
|
||||
@@ -30,15 +30,15 @@ func HandleSearch(conn net.Conn, req models.Request) {
|
||||
|
||||
searchResults := plugins.FuzzySearch(query, pluginList)
|
||||
|
||||
if category, ok := req.Params["category"].(string); ok && category != "" {
|
||||
if category := models.GetOr(req, "category", ""); category != "" {
|
||||
searchResults = plugins.FilterByCategory(category, searchResults)
|
||||
}
|
||||
|
||||
if compositor, ok := req.Params["compositor"].(string); ok && compositor != "" {
|
||||
if compositor := models.GetOr(req, "compositor", ""); compositor != "" {
|
||||
searchResults = plugins.FilterByCompositor(compositor, searchResults)
|
||||
}
|
||||
|
||||
if capability, ok := req.Params["capability"].(string); ok && capability != "" {
|
||||
if capability := models.GetOr(req, "capability", ""); capability != "" {
|
||||
searchResults = plugins.FilterByCapability(capability, searchResults)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleUninstall(conn net.Conn, req models.Request) {
|
||||
name, ok := req.Params["name"].(string)
|
||||
name, ok := models.Get[string](req, "name")
|
||||
if !ok {
|
||||
models.RespondError(conn, req.ID, "missing or invalid 'name' parameter")
|
||||
return
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func HandleUpdate(conn net.Conn, req models.Request) {
|
||||
name, ok := req.Params["name"].(string)
|
||||
name, ok := models.Get[string](req, "name")
|
||||
if !ok {
|
||||
models.RespondError(conn, req.ID, "missing or invalid 'name' parameter")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user