Skip to content

Commit

Permalink
feat: improvement preview data
Browse files Browse the repository at this point in the history
  • Loading branch information
makinosp committed Nov 4, 2024
1 parent 59a4b19 commit 295642e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions harmonie/Previews/Models/World.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ extension PreviewData {
popularity: 5,
heat: 3
)

static let worldList = [ bar, casino, fuji, chinatown, nightCity ]
}

extension World {
Expand Down
9 changes: 1 addition & 8 deletions harmonie/Previews/Services/WorldPreviewService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ final actor WorldPreviewService: APIService, WorldServiceProtocol {
let client: APIClient

func fetchWorld(worldId: String) async throws -> World {
switch worldId {
case PreviewData.bar.id:
PreviewData.bar
case PreviewData.casino.id:
PreviewData.casino
default:
PreviewData.bar
}
PreviewData.worldList.first { $0.id == worldId } ?? PreviewData.bar
}

func fetchFavoritedWorlds() async throws -> [FavoriteWorld] {
Expand Down

0 comments on commit 295642e

Please sign in to comment.