Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions Share/NCShareExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,19 @@
@MainActor
func uploadAndExit() async {
var error: NKError?
guard let window = self.view.window else {
return
}
let horizontalLayout = horizontalLayoutBanner(bounds: window.bounds,
safeAreaInsets: window.safeAreaInsets,
idiom: window.traitCollection.userInterfaceIdiom)

let payload = LucidBannerPayload(stage: .button,
backgroundColor: Color(.systemBackground),
vPosition: .center,
horizontalLayout: .centered(width: 500),
horizontalLayout: horizontalLayout,
blocksTouches: true)
token = showUploadBanner(scene: self.view.window?.windowScene,
token = showUploadBanner(scene: window.windowScene,
payload: payload,
allowMinimizeOnTap: false,
onButtonTap: {
Expand All @@ -399,14 +406,11 @@
}

if error == .success {
let payloadUpdate = LucidBannerPayload.Update(stage: .success)
LucidBanner.shared.update(payload: payloadUpdate, for: self.token)
LucidBanner.shared.update(payload: LucidBannerPayload.Update(stage: .success, horizontalLayout: .centered(width: 100)),
for: self.token)
} else {
let payload = LucidBannerPayload.Update(
subtitle: error?.errorDescription,
stage: .error
)
LucidBanner.shared.update(payload: payload, for: self.token)
LucidBanner.shared.update(payload: LucidBannerPayload.Update(subtitle: error?.errorDescription,stage: .error),

Check warning on line 412 in Share/NCShareExtension.swift

View workflow job for this annotation

GitHub Actions / Lint

Comma Spacing Violation: There should be no space before and one after any comma (comma)
for: self.token)
}

LucidBanner.shared.dismiss(after: 2) {
Expand Down Expand Up @@ -444,11 +448,9 @@
if metadata.isDirectoryE2EE {
error = await NCNetworkingE2EEUpload().upload(metadata: metadata, session: session, controller: self, stageBanner: nil, tokenBanner: self.token)
} else if metadata.chunk > 0 {
let payload = LucidBannerPayload.Update(
systemImage: "gearshape.arrow.triangle.2.circlepath",
imageAnimation: .rotate
)
LucidBanner.shared.update(payload: payload, for: self.token)
LucidBanner.shared.update(payload: LucidBannerPayload.Update(systemImage: "gearshape.arrow.triangle.2.circlepath",
imageAnimation: .rotate),
for: self.token)
let task = Task { () -> (account: String, file: NKFile?, error: NKError) in
let results = await NCNetworking.shared.uploadChunkFile(metadata: metadata) { total, counter in
Task {@MainActor in
Expand Down Expand Up @@ -494,9 +496,8 @@
dateModificationFile: metadata.date as Date) { _ in
} progressHandler: { _, _, fractionCompleted in
Task {@MainActor in
LucidBanner.shared.update(
payload: LucidBannerPayload.Update(progress: fractionCompleted),
for: self.token)
LucidBanner.shared.update(payload: LucidBannerPayload.Update(progress: fractionCompleted),
for: self.token)
}
}
error = results.error
Expand Down
1 change: 0 additions & 1 deletion iOSClient/GUI/Lucid Banner/HelperBanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public extension View {
allowMinimizeOnTap: Bool,
@ViewBuilder _ content: () -> Content) -> some View {
let isError = state.payload.stage == .error
// let isSuccess = state.payload.stage == .success
let isMinimized = state.variant == .alternate

let cornerRadius: CGFloat = isMinimized ? 15 : 25
Expand Down
21 changes: 2 additions & 19 deletions iOSClient/GUI/Lucid Banner/UploadBannerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,8 @@ func showUploadBanner(scene: UIWindowScene?,

#if !EXTENSION
if allowMinimizeOnTap {
LucidBannerVariantCoordinator.shared.register(token: token) { context in
let bounds = context.bounds
let insets = context.safeAreaInsets
let trait = context.window.traitCollection
let controller = SceneManager.shared.getController(scene: context.window.windowScene)
let tabBarHeight: CGFloat = controller?.barHeightBottom ?? 0
let verticalSpacing: CGFloat
let y: CGFloat

if trait.horizontalSizeClass == .regular {
verticalSpacing = 24
y = bounds.maxY - insets.bottom - verticalSpacing
} else {
verticalSpacing = 20
y = bounds.maxY - tabBarHeight - insets.bottom - verticalSpacing
}

return LucidBannerVariantCoordinator.VariantResolution(
targetPoint: CGPoint(x: bounds.midX, y: y),
LucidBannerVariantCoordinator.shared.register(token: token) { _ in
return .init(
payloadUpdate: .init(
horizontalLayout: .centered(width: 100),
swipeToDismiss: false,
Expand Down
1 change: 0 additions & 1 deletion iOSClient/Main/NCDragDrop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ class NCDragDrop: NSObject {

let payload = LucidBannerPayload(stage: nil,
backgroundColor: Color(.systemBackground),
vPosition: .center,
horizontalLayout: horizontalLayout,
blocksTouches: false,
draggable: false)
Expand Down
3 changes: 1 addition & 2 deletions iOSClient/Networking/NCNetworkingProcess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@

await runMetadataPipelineAsync(metadatas: metadatas)

// TODO: Check temperature

Check warning on line 243 in iOSClient/Networking/NCNetworkingProcess.swift

View workflow job for this annotation

GitHub Actions / Lint

Todo Violation: TODOs should be resolved (Check temperature) (todo)

if lastUsedInterval != minInterval {
await startTimer(interval: minInterval)
Expand Down Expand Up @@ -399,7 +399,6 @@
safeAreaInsets: window.safeAreaInsets,
idiom: window.traitCollection.userInterfaceIdiom)
let payload = LucidBannerPayload(backgroundColor: Color(.systemBackground),
vPosition: .center,
horizontalLayout: horizontalLayout,
blocksTouches: true,
draggable: false)
Expand Down Expand Up @@ -460,7 +459,7 @@
payload: LucidBannerPayload(stage: .button,
backgroundColor: Color(.systemBackground),
vPosition: .bottom,
verticalMargin: 80,
verticalMargin: 50,
horizontalLayout: horizontalLayout,
blocksTouches: false,
draggable: true),
Expand Down
Loading