mirror of
https://github.com/neon443/NearFuture.git
synced 2026-03-11 14:56:15 +00:00
can now export events, cant import lol
This commit is contained in:
@@ -16,6 +16,7 @@ struct SettingsView: View {
|
||||
@State private var lastSyncWasNormalAgo: Bool = false
|
||||
@State private var localCountEqualToiCloud: Bool = false
|
||||
@State private var icloudCountEqualToLocal: Bool = false
|
||||
@State private var importStr: String = ""
|
||||
|
||||
func updateStatus() {
|
||||
let vm = viewModel
|
||||
@@ -67,6 +68,48 @@ struct SettingsView: View {
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
NavigationLink() {
|
||||
NavigationView() {
|
||||
Button() {
|
||||
UIPasteboard.general.string = "\(viewModel.exportEvents())"
|
||||
print(viewModel.exportEvents())
|
||||
} label: {
|
||||
Text("copy")
|
||||
}
|
||||
Text("\(viewModel.exportEvents())")
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: "list.bullet.rectangle")
|
||||
Text("Export events")
|
||||
}
|
||||
NavigationLink() {
|
||||
NavigationView() {
|
||||
VStack {
|
||||
TextEditor(text: $importStr)
|
||||
.foregroundStyle(.foreground, .gray)
|
||||
.background(.gray)
|
||||
.frame(width: 200, height: 400)
|
||||
.shadow(radius: 5)
|
||||
Button() {
|
||||
viewModel.importEvents(importStr)
|
||||
} label: {
|
||||
Text("import events")
|
||||
}
|
||||
.buttonStyle(BorderedProminentButtonStyle())
|
||||
Button() {
|
||||
if let pb = UIPasteboard.general.string {
|
||||
print(pb)
|
||||
}
|
||||
} label: {
|
||||
Text("print pb")
|
||||
}
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: "square.and.arrow.down")
|
||||
Text("Import events")
|
||||
}
|
||||
|
||||
Section("Danger Zone") {
|
||||
Button("Delete local data", role: .destructive) {
|
||||
viewModel.dangerClearLocalData()
|
||||
|
||||
Reference in New Issue
Block a user