Changeset 0.28.7 (#193)
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
// Called once at startup. Does NOT overwrite the enabled flag — admin
|
||||
// toggles survive restarts.
|
||||
func (e *Engine) SeedSurfaces() {
|
||||
if e.stores.Surfaces == nil {
|
||||
if e.stores.Packages == nil {
|
||||
log.Printf("[pages] Surface registry not available — skipping seed")
|
||||
return
|
||||
}
|
||||
@@ -27,7 +27,7 @@ func (e *Engine) SeedSurfaces() {
|
||||
"auth": s.Auth,
|
||||
"layout": s.Layout,
|
||||
}
|
||||
if err := e.stores.Surfaces.Seed(ctx, s.ID, s.Title, s.Source, manifest); err != nil {
|
||||
if err := e.stores.Packages.Seed(ctx, s.ID, s.Title, s.Source, manifest); err != nil {
|
||||
log.Printf("[pages] Failed to seed surface %q: %v", s.ID, err)
|
||||
}
|
||||
}
|
||||
@@ -42,11 +42,11 @@ func (e *Engine) IsSurfaceEnabled(surfaceID string) bool {
|
||||
if surfaceID == "chat" || surfaceID == "admin" {
|
||||
return true
|
||||
}
|
||||
if e.stores.Surfaces == nil {
|
||||
if e.stores.Packages == nil {
|
||||
return true // No registry = all surfaces enabled (backward compat)
|
||||
}
|
||||
ctx := context.Background()
|
||||
sr, err := e.stores.Surfaces.Get(ctx, surfaceID)
|
||||
sr, err := e.stores.Packages.Get(ctx, surfaceID)
|
||||
if err != nil || sr == nil {
|
||||
return true // Not in registry = assume enabled (backward compat)
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func (e *Engine) IsSurfaceEnabled(surfaceID string) bool {
|
||||
|
||||
// EnabledSurfaceIDs returns a list of enabled surface IDs for nav rendering.
|
||||
func (e *Engine) EnabledSurfaceIDs() []string {
|
||||
if e.stores.Surfaces == nil {
|
||||
if e.stores.Packages == nil {
|
||||
// No registry — return all core surface IDs
|
||||
var all []string
|
||||
for _, s := range e.surfaces {
|
||||
@@ -64,7 +64,7 @@ func (e *Engine) EnabledSurfaceIDs() []string {
|
||||
return all
|
||||
}
|
||||
ctx := context.Background()
|
||||
ids, err := e.stores.Surfaces.ListEnabled(ctx)
|
||||
ids, err := e.stores.Packages.ListEnabled(ctx)
|
||||
if err != nil {
|
||||
log.Printf("[pages] Failed to load enabled surfaces: %v", err)
|
||||
// Fallback: return all core surface IDs
|
||||
|
||||
Reference in New Issue
Block a user