Share Extension: account picker first, hidden folders follow the app's filter + unlock
The app now publishes every uploadable account, the active one, the three lock settings and each account's own hidden-files filter (ShareAccountSync). The sheet lists accounts first when there are several, asks for unlock to use a non-active account (login lock + account-switching lock), and shows hidden folders per the account's app setting behind the hidden-files unlock. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
0cda4a1241
commit
a37524e959
@@ -80,22 +80,21 @@ enum NativeServices {
|
||||
|
||||
// MARK: - Account for the Share Extension
|
||||
|
||||
/// `share_account`: Dart tells native which account is active so the Share
|
||||
/// Extension - a separate process with no Flutter engine - can list folders
|
||||
/// and upload as it. Stored in the shared Keychain group.
|
||||
/// `share_account`: Dart hands native every account that can upload, which
|
||||
/// one is active, and the app-lock settings, so the Share Extension - a
|
||||
/// separate process with no Flutter engine - can list folders and upload as
|
||||
/// them. Stored in the shared Keychain group.
|
||||
private static func registerShareAccount(messenger: FlutterBinaryMessenger) {
|
||||
FlutterMethodChannel(name: "dev.ayushya.noo/share_account", binaryMessenger: messenger)
|
||||
.setMethodCallHandler { call, result in
|
||||
switch call.method {
|
||||
case "setAccount":
|
||||
case "setAccounts":
|
||||
handle(call, result) { args in
|
||||
try SharedAccountStore.save(
|
||||
SharedAccount(
|
||||
serverUrl: try string(args, "serverUrl"),
|
||||
username: try string(args, "username"),
|
||||
authHeader: try string(args, "authHeader"),
|
||||
displayName: (args["displayName"] as? String) ?? ""
|
||||
))
|
||||
guard let json = args["accounts"] as? String,
|
||||
let data = json.data(using: .utf8),
|
||||
let accounts = try? JSONDecoder().decode(SharedAccounts.self, from: data)
|
||||
else { throw TransferError(message: "Bad accounts payload.") }
|
||||
try SharedAccountStore.save(accounts)
|
||||
}
|
||||
case "clearAccount":
|
||||
SharedAccountStore.clear()
|
||||
|
||||
Reference in New Issue
Block a user