Simplify error handling in wardrobe v2

This commit is contained in:
Emi Matchu 2025-11-02 07:58:30 +00:00
parent a00d57bcbb
commit 0651a2871c
3 changed files with 5 additions and 6 deletions

View file

@ -102,7 +102,7 @@ class OutfitsController < ApplicationController
# Preload the manifests for all visible layers, so they load efficiently
# in parallel rather than sequentially when rendering
SwfAsset.preload_manifests(@outfit.visible_layers) if @outfit.pet_state
SwfAsset.preload_manifests(@outfit.visible_layers)
render layout: false
end

View file

@ -170,6 +170,8 @@ class Outfit < ApplicationRecord
end
def visible_layers
return [] if pet_state.nil?
# TODO: This method doesn't currently handle alt styles! If the outfit has
# an alt_style, we should use its layers instead of pet_state layers, and
# filter items to only those with body_id=0. This isn't needed yet because

View file

@ -19,16 +19,13 @@
= turbo_frame_tag "outfit-editor" do
.wardrobe-container
.outfit-preview-section
- if @outfit.pet_state
= outfit_viewer @outfit
- elsif @pet_type.nil?
- if @pet_type.nil?
.no-preview-message
%p
We haven't seen this kind of pet before! Try a different species/color
combination.
- else
.no-preview-message
%p Loading...
= outfit_viewer @outfit
.outfit-controls-section
%h1 Customize your pet