mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
still need to fix state issues
This commit is contained in:
2 files changed
+32
-31
No files matched your search
@@ -7,38 +7,38 @@
|
|||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
@main
|
|
||||||
struct StickerSlackApp: App {
|
|
||||||
@ObservedObject var emojiHoarder: EmojiHoarder = EmojiHoarder()
|
|
||||||
@ObservedObject var gifhoarder: GifHoarder = GifHoarder()
|
|
||||||
|
|
||||||
@State var importingEmojiPack: Bool = false
|
|
||||||
@State var pack: EmojiPack = .new()
|
|
||||||
|
|
||||||
var body: some Scene {
|
|
||||||
WindowGroup {
|
|
||||||
ContentView(emojiHoarder: emojiHoarder, gifhoarder: gifhoarder)
|
|
||||||
.onOpenURL { url in
|
|
||||||
if let imported = EmojiPack(fromShareLink: url) {
|
|
||||||
importingEmojiPack = true
|
|
||||||
pack = imported
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.sheet(isPresented: $importingEmojiPack) {
|
|
||||||
EmojiPackImporterView(emojiHoarder: emojiHoarder, pack: $pack)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//@main
|
//@main
|
||||||
//class StickerSlackApp: UIResponder, UIApplicationDelegate {
|
//struct StickerSlackApp: App {
|
||||||
// var window: UIWindow?
|
// @ObservedObject var emojiHoarder: EmojiHoarder = EmojiHoarder()
|
||||||
|
// @ObservedObject var gifhoarder: GifHoarder = GifHoarder()
|
||||||
//
|
//
|
||||||
// func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool {
|
// @State var importingEmojiPack: Bool = false
|
||||||
// window = UIWindow(frame: UIScreen.main.bounds)
|
// @State var pack: EmojiPack = .new()
|
||||||
// window?.rootViewController = TabbedContentView()
|
//
|
||||||
// window?.makeKeyAndVisible()
|
// var body: some Scene {
|
||||||
// return true
|
// WindowGroup {
|
||||||
|
// ContentView(emojiHoarder: emojiHoarder, gifhoarder: gifhoarder)
|
||||||
|
// .onOpenURL { url in
|
||||||
|
// if let imported = EmojiPack(fromShareLink: url) {
|
||||||
|
// importingEmojiPack = true
|
||||||
|
// pack = imported
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// .sheet(isPresented: $importingEmojiPack) {
|
||||||
|
// EmojiPackImporterView(emojiHoarder: emojiHoarder, pack: $pack)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
@main
|
||||||
|
class StickerSlackApp: UIResponder, UIApplicationDelegate {
|
||||||
|
var window: UIWindow?
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool {
|
||||||
|
window = UIWindow(frame: UIScreen.main.bounds)
|
||||||
|
window?.rootViewController = TabbedContentView()
|
||||||
|
window?.makeKeyAndVisible()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -76,6 +76,7 @@ struct EmojiPackManager: View {
|
|||||||
Button("", systemImage: "trash") {
|
Button("", systemImage: "trash") {
|
||||||
showDeleteAlert.toggle()
|
showDeleteAlert.toggle()
|
||||||
}
|
}
|
||||||
|
.disabled(selection.isEmpty)
|
||||||
.confirmationDialog("These items will be deleted immediately", isPresented: $showDeleteAlert) {
|
.confirmationDialog("These items will be deleted immediately", isPresented: $showDeleteAlert) {
|
||||||
Button("Delete \(selection.count) pack\(selection.count.plural)", role: .destructive) {
|
Button("Delete \(selection.count) pack\(selection.count.plural)", role: .destructive) {
|
||||||
for pack in selection {
|
for pack in selection {
|
||||||
|
|||||||