fix: seed starting backdrop on every load, not just first launch
SeedStartingBackdrop() moved outside the Scenes.Count==0 guard so it fires on every startup. Existing layouts with a Background source are skipped (idempotent check).
This commit is contained in:
@@ -1354,8 +1354,8 @@ public class MainViewModel : ViewModelBase
|
||||
{
|
||||
foreach (var name in SceneCatalog.All)
|
||||
AddScene(name);
|
||||
SeedStartingBackdrop();
|
||||
}
|
||||
SeedStartingBackdrop();
|
||||
|
||||
// The live backdrop belongs to Live only; a pre-policy DB may have
|
||||
// backdrops lingering in other scenes — drop them, then
|
||||
@@ -1740,6 +1740,10 @@ public class MainViewModel : ViewModelBase
|
||||
{
|
||||
try
|
||||
{
|
||||
var starting = Scenes.FirstOrDefault(s => SceneCatalog.Is(s.Name, "Starting"));
|
||||
if (starting == null) return;
|
||||
if (starting.Elements.OfType<Source>().Any(s => s.Type == SourceType.Background)) return;
|
||||
|
||||
var uri = new Uri("pack://application:,,,/Assets/starting-backdrop.jpg", UriKind.Absolute);
|
||||
using var stream = Application.GetResourceStream(uri)?.Stream;
|
||||
if (stream == null) return;
|
||||
@@ -1748,8 +1752,6 @@ public class MainViewModel : ViewModelBase
|
||||
var bytes = ms.ToArray();
|
||||
var assetId = AddAsset(bytes);
|
||||
if (assetId == null) return;
|
||||
var starting = Scenes.FirstOrDefault(s => SceneCatalog.Is(s.Name, "Starting"));
|
||||
if (starting == null) return;
|
||||
starting.Elements.Add(new Source
|
||||
{
|
||||
Name = "Background",
|
||||
|
||||
Reference in New Issue
Block a user