diff LazyBear/Views/Profile/Helpers/WatchlistCreator.swift @ 430:c78d5b5b3bda

Minor updates
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sat, 19 Jun 2021 16:21:26 +0200
parents 4effac4733b0
children
line wrap: on
line diff
--- a/LazyBear/Views/Profile/Helpers/WatchlistCreator.swift	Sat Jun 19 16:20:58 2021 +0200
+++ b/LazyBear/Views/Profile/Helpers/WatchlistCreator.swift	Sat Jun 19 16:21:26 2021 +0200
@@ -14,7 +14,7 @@
     @State private var watchlistNameIsEmpty = false
     
     @Environment(\.managedObjectContext) private var moc
-    @Environment(\.presentationMode) private var presentationMode
+    @Environment(\.presentationMode) private var watchlistCreatorPresentation
     
     var body: some View {
         NavigationView {
@@ -60,7 +60,7 @@
                 Alert(
                     title: Text("Your watchlist won't be saved"),
                     message: Text("This action can't be undo"),
-                    primaryButton: .destructive(Text("Exit")) { presentationMode.wrappedValue.dismiss() },
+                    primaryButton: .destructive(Text("Exit")) { watchlistCreatorPresentation.wrappedValue.dismiss() },
                     secondaryButton: .cancel()
                 )
             }
@@ -105,7 +105,7 @@
             do {
                 try moc.save()
                 print("Watchlist created")
-                presentationMode.wrappedValue.dismiss()  // Dismiss view
+                watchlistCreatorPresentation.wrappedValue.dismiss()  // Dismiss view
             } catch {
                 print(error.localizedDescription)
             }