mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-03 16:41:26 +01:00
feat(core,app,android,ios): finish adding a first share where it pays off
- A link with a password of its own, added without one, now fails as "This link has a password of its own" instead of the handshake's refusal. The link's public flags are only asked for after a refusal. The desktop form turns its password toggle on. - After the first share is added, all three clients go to the library. While that share is being listed, the empty library says so instead of offering to add a share. - The desktop library offers posters and synopses once there is a library to put them on. The offer says what is sent, links to Settings, never turns anything on, and "Not now" is remembered.
This commit is contained in:
1 parent
0f96cc4514
commit
89e55aac12
11 files changed
+150
-10
No files matched your search
@@ -145,6 +145,10 @@ struct LibraryView: View {
|
||||
LibrarySkeleton()
|
||||
} else if model.titles.isEmpty && !model.query.trimmingCharacters(in: .whitespaces).isEmpty {
|
||||
EmptyState("Nothing matches", "No title in the library is called “\(model.query.trimmingCharacters(in: .whitespaces))”.")
|
||||
} else if model.titles.isEmpty, let activity = model.activity {
|
||||
// A share just added: say it is being looked through, rather than
|
||||
// offer to add the one that is already filling the page.
|
||||
EmptyState("Looking through the share", "\(activity) Its titles appear here once it has been listed.")
|
||||
} else if model.titles.isEmpty {
|
||||
ScrollView {
|
||||
EmptyState(
|
||||
|
||||
@@ -6,6 +6,7 @@ struct SharesView: View {
|
||||
@Environment(\.scheme) private var scheme
|
||||
/// A link opened in this app: the Add form opens with it filled in.
|
||||
@Binding var incomingLink: String?
|
||||
var onFirstShareAdded: () -> Void = {}
|
||||
|
||||
@State private var showAdd = false
|
||||
@State private var signingIn = false
|
||||
@@ -57,7 +58,10 @@ struct SharesView: View {
|
||||
}
|
||||
.sheet(isPresented: Binding(get: { showAdd || incomingLink != nil }, set: { if !$0 { showAdd = false; incomingLink = nil } })) {
|
||||
AddShareSheet(initialUrl: incomingLink ?? "") { name, url, password in
|
||||
await model.addShare(name: name, url: url, password: password)
|
||||
let first = model.titles.isEmpty
|
||||
let refusal = await model.addShare(name: name, url: url, password: password)
|
||||
if refusal == nil && first { onFirstShareAdded() }
|
||||
return refusal
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: Binding(
|
||||
|
||||
Reference in new issue
Block a user