Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
244 commits
Select commit Hold shift + click to select a range
db4d8f0
Implement p2p main view
dhekra-rouatbi Feb 3, 2025
13a533f
Add Wifi connection Screen and permessions
Rimktarii Feb 5, 2025
4ae0e42
Update WifiConnectionView
Rimktarii Feb 5, 2025
c217d11
Add RegularTextView and Create ConnectToDeviceView Screen
Rimktarii Feb 5, 2025
c176e5a
Create ConnectToDeviceView
Rimktarii Feb 5, 2025
ac7951a
Create ConnectToDeviceManuallyView
Rimktarii Feb 6, 2025
a9b0c9d
Add Nearby Sharing to connections
Rimktarii Feb 6, 2025
ca47f86
Create secondary Tella button type
Rimktarii Feb 7, 2025
bf47efe
Rename Classes
Rimktarii Feb 7, 2025
33930da
Update Views names and Add New Sender classes
Rimktarii Feb 10, 2025
32f1a21
Add RecipientConnectToDeviceManuallyView
Rimktarii Feb 10, 2025
6e297df
Fix PeerToPeer design and update the destination
Rimktarii Feb 11, 2025
b5c844d
Handle navigation
Rimktarii Feb 11, 2025
0648f25
Add waiting screen and adapt TellaButtonView
Rimktarii Feb 14, 2025
0cb844f
Create RecipientFilesRequestView screen
Rimktarii Feb 14, 2025
8d8f091
Implement QRCodeScanner and QRCodeGenerator
dhekra-rouatbi Feb 14, 2025
1c0acc2
Validate fields in SenderConnectToDeviceManuallyView
Rimktarii Feb 25, 2025
bb15e0e
Delete Tella/Components/WifiConnexionView.swift
Rimktarii Feb 25, 2025
d6e295b
Fix TellaButtonView height
Rimktarii Feb 25, 2025
658069a
Create a generic AddFileView ( AddFileBottomSheetView and AddFileGrid…
Rimktarii Feb 26, 2025
740ca8d
Refactor Add Files in draftviews
Rimktarii Feb 27, 2025
fccfbfc
Fix add file in uwazi (Refacor)
Rimktarii Feb 28, 2025
62bfbac
Generate QR code with device ip address and sha256 of generated certi…
dhekra-rouatbi Mar 11, 2025
bb947d7
Implement Register API
dhekra-rouatbi Apr 1, 2025
5d82064
Implement Connection failed, Handle server errors, update p2p main vi…
dhekra-rouatbi Apr 3, 2025
f364d8d
Update strings, organise files and update design
dhekra-rouatbi Apr 3, 2025
2d33f2e
Improve code and start working on prepare upload API
dhekra-rouatbi Apr 7, 2025
be49d39
Update Prepare upload models
dhekra-rouatbi Apr 7, 2025
5a6e568
Working on Prepare upload
dhekra-rouatbi Apr 8, 2025
c6f5bab
Fix register API issue
dhekra-rouatbi Apr 8, 2025
4f38c5d
Fix register API issue
dhekra-rouatbi Apr 9, 2025
26c2dc4
Fix crash
dhekra-rouatbi Apr 10, 2025
7b3ddcb
Fix certificate
dhekra-rouatbi Apr 10, 2025
bcf5614
Working on certificate
dhekra-rouatbi Apr 10, 2025
7374da1
Fix server response
dhekra-rouatbi Apr 11, 2025
7c88796
Fix server response
dhekra-rouatbi Apr 11, 2025
f1e3df3
Fix server response
dhekra-rouatbi Apr 14, 2025
5d8186a
Refactor certificate generator
dhekra-rouatbi Apr 14, 2025
cda1dd0
Code improvement
dhekra-rouatbi Apr 15, 2025
93f114c
Code improvement
dhekra-rouatbi Apr 15, 2025
2df31dd
Update Algorithm to RSA
dhekra-rouatbi Apr 15, 2025
53b460b
Code improvement
dhekra-rouatbi Apr 15, 2025
f733094
Implement manually connection
dhekra-rouatbi Apr 17, 2025
375acfc
Integrate typography styles into P2P views
dhekra-rouatbi Apr 23, 2025
aa5dd66
Integrate typography styles into P2P views
dhekra-rouatbi Apr 23, 2025
6761e14
Integrate typography styles into P2P views and Code improvement
dhekra-rouatbi Apr 23, 2025
f52d45b
Update hash format
dhekra-rouatbi Apr 23, 2025
6015a6d
Update QRCode size and Fix arrows orientation in Tips to connect view
dhekra-rouatbi Apr 24, 2025
3d4190c
Fix conflict
dhekra-rouatbi Apr 30, 2025
b1424a6
Update connect manually scenario
dhekra-rouatbi May 13, 2025
c7b4d3a
Implement prepare upload: API, server response and UI
dhekra-rouatbi May 16, 2025
6cd74e6
Improve code
dhekra-rouatbi May 16, 2025
2963296
Improve code
dhekra-rouatbi May 16, 2025
f024384
Handle errors in prepare upload
dhekra-rouatbi May 19, 2025
6380749
Update forbidden error message
dhekra-rouatbi May 19, 2025
dbdee33
Refactor the P2P server class and handle the sender's discard respons…
dhekra-rouatbi May 19, 2025
dfa3e1a
Handle discard and start over action
dhekra-rouatbi May 20, 2025
7857e87
Handle close connection API and generate server response
dhekra-rouatbi May 20, 2025
481ed65
Handle back button actions
dhekra-rouatbi May 21, 2025
61a0cbe
Refactor PeertoPeerServer
dhekra-rouatbi May 22, 2025
d25e649
Update the manual connection process
dhekra-rouatbi May 30, 2025
7c06ba6
remove unused code
dhekra-rouatbi Jun 2, 2025
5088667
Update PeerToPeerRepository class name
dhekra-rouatbi Jun 2, 2025
aad35b4
Refactor HTTP request parsing on the server to use the llhttp library
dhekra-rouatbi Jun 3, 2025
00b2c3c
Refactor HTTP Response Builder
dhekra-rouatbi Jun 3, 2025
f6fb431
Add AnyView to some View
dhekra-rouatbi Jun 4, 2025
3c69412
Working on p2p
dhekra-rouatbi Jun 4, 2025
65ac75e
Add ping endpoint
dhekra-rouatbi Jun 9, 2025
d91405a
Add constants
dhekra-rouatbi Jun 9, 2025
98ef366
delete unnecessary debugs
dhekra-rouatbi Jun 9, 2025
80edc3b
unwrap the clientIdentity with a guard statement
dhekra-rouatbi Jun 9, 2025
0cf3452
Throw an error if there is an error on parsing: llhttp_execute
dhekra-rouatbi Jun 9, 2025
8fd807f
Working on upload files and manual connection
dhekra-rouatbi Jun 23, 2025
b5cbad1
Update certificate hash text alignment
dhekra-rouatbi Jun 23, 2025
af0dfd3
Refactor the server parameters into distinct classes
dhekra-rouatbi Jun 25, 2025
aee5a38
WIP on handle File Upload
dhekra-rouatbi Jun 26, 2025
6b7e66e
handle File Upload : Working on the parser
dhekra-rouatbi Jun 27, 2025
f230103
Delete unused code
dhekra-rouatbi Jun 30, 2025
ea52c5d
handle File Upload : Working on the parser
dhekra-rouatbi Jun 30, 2025
a6f7184
Update hash
dhekra-rouatbi Jun 30, 2025
08ae3ee
generate hash of the entire certificate instead of hashing only the p…
ValbuenaG Jun 30, 2025
033f347
Update hash
dhekra-rouatbi Jul 1, 2025
6e15af6
Working on receiving files and display the progress
dhekra-rouatbi Jul 9, 2025
ff552a2
Improvement
dhekra-rouatbi Jul 9, 2025
c36ac94
Code improvement
dhekra-rouatbi Jul 9, 2025
2e9c055
Saving the received files
dhekra-rouatbi Jul 9, 2025
cd18735
Progress flow and results view
dhekra-rouatbi Jul 16, 2025
0d486da
Update design
dhekra-rouatbi Jul 16, 2025
5bae28f
Remove back buttons
dhekra-rouatbi Jul 16, 2025
cba9bac
Update typography
dhekra-rouatbi Jul 16, 2025
7b89c22
Fix styles
dhekra-rouatbi Jul 17, 2025
a337926
Add missing title to sender progress view
dhekra-rouatbi Jul 17, 2025
4226506
Fix back actions
dhekra-rouatbi Jul 17, 2025
2daf97c
Fix back actions
dhekra-rouatbi Jul 17, 2025
1d471b0
Update p2pLearnMore link
dhekra-rouatbi Jul 17, 2025
2448c19
Update parser
dhekra-rouatbi Jul 17, 2025
48bca96
Fix parser
dhekra-rouatbi Jul 17, 2025
5758807
Stop the server listener after finishing transfer
dhekra-rouatbi Jul 21, 2025
dfdc9b6
Centralise the server instance and improve code
dhekra-rouatbi Jul 23, 2025
ddd32c3
update listener?.cancel() with stopListening
dhekra-rouatbi Jul 23, 2025
5f55880
clean code
dhekra-rouatbi Jul 23, 2025
8e41486
Add status icon and server initialisation
dhekra-rouatbi Jul 24, 2025
bf12619
Improve code
dhekra-rouatbi Jul 24, 2025
59801e7
Move PeerToPeerEvent to another class
dhekra-rouatbi Jul 25, 2025
d68e59d
Show the QRCode only if the server started
dhekra-rouatbi Jul 25, 2025
a2ac640
Improve code
dhekra-rouatbi Jul 25, 2025
f2affee
Improve code
dhekra-rouatbi Jul 25, 2025
b92ce94
WIP cancel receiving files
dhekra-rouatbi Jul 26, 2025
6a7e916
Add scroll to Sender prepare file transfer view
dhekra-rouatbi Jul 27, 2025
c3f9d30
Fix fields validation
dhekra-rouatbi Jul 27, 2025
39f131c
Fix closeConnection issue
dhekra-rouatbi Jul 28, 2025
b14d0b8
Improve NetworkManager
dhekra-rouatbi Jul 29, 2025
be6a7cb
Improvements
dhekra-rouatbi Jul 29, 2025
8f17d50
Improve NetworkManager
dhekra-rouatbi Jul 29, 2025
3d74cb5
Add connections queue
dhekra-rouatbi Jul 29, 2025
fbd4cbb
update the completion with async/await
dhekra-rouatbi Jul 29, 2025
6a703c2
Revert "update the completion with async/await"
dhekra-rouatbi Jul 29, 2025
9a3ae19
Revert "Add connections queue"
dhekra-rouatbi Jul 29, 2025
3c9ddaf
Update p2p learn more link
dhekra-rouatbi Jul 30, 2025
92c529f
Fix the QRCode initialisation
dhekra-rouatbi Jul 30, 2025
32ea34b
update the completion with async/await
dhekra-rouatbi Jul 30, 2025
6994a7a
update the completion with async/await
dhekra-rouatbi Jul 30, 2025
093271b
update the completion with async/await
dhekra-rouatbi Jul 31, 2025
b1f7a84
Add the "Add button" to home view
dhekra-rouatbi Aug 1, 2025
ce22e86
Update p2p settings design
dhekra-rouatbi Aug 1, 2025
eb6de9a
Convert data to base64EncodedString in request body
dhekra-rouatbi Aug 5, 2025
0367e6e
Connect manually: Remove shouldValidateOnChange: true
dhekra-rouatbi Aug 5, 2025
7806cc8
Update design
dhekra-rouatbi Aug 5, 2025
7788cd8
Disable the check button when there is no connection
dhekra-rouatbi Aug 6, 2025
221a8f8
Stop the server when the app enters the background
dhekra-rouatbi Aug 6, 2025
357a8ac
Fix the next iteration of scanning a Code
dhekra-rouatbi Aug 6, 2025
2f1f479
Fix cancel receiving action
dhekra-rouatbi Aug 6, 2025
270bd39
Update data encode
dhekra-rouatbi Aug 6, 2025
11dc274
Update prepare upload data encode
dhekra-rouatbi Aug 6, 2025
a75b47c
Update the file name if it exists in the database
dhekra-rouatbi Aug 6, 2025
c235967
Update previews
dhekra-rouatbi Aug 6, 2025
486c377
Implement view files
dhekra-rouatbi Aug 8, 2025
44c1a4c
Replace peer to peer with nearby sharing
dhekra-rouatbi Aug 8, 2025
0c97ead
Replace peer to peer with nearby sharing
dhekra-rouatbi Aug 8, 2025
ef94a4f
Replace peer to peer with nearby sharing
dhekra-rouatbi Aug 8, 2025
040d751
Update prepare upload data encode
dhekra-rouatbi Aug 8, 2025
23222ed
Revert "Update prepare upload data encode"
dhekra-rouatbi Aug 8, 2025
88193d2
Hide add button in received files
dhekra-rouatbi Aug 8, 2025
c1662d2
Replace peer to peer with nearby sharing
dhekra-rouatbi Aug 8, 2025
0a2da16
Move NearbySharingState into an actor to prevent concurrent access
dhekra-rouatbi Aug 13, 2025
747b695
Move NetworkManager into an actor to prevent concurrent access
dhekra-rouatbi Aug 14, 2025
3d13fc7
Add connection Changed Toast
dhekra-rouatbi Aug 15, 2025
6542d1b
receive eventPublisher on main thread
dhekra-rouatbi Aug 15, 2025
08aa9fc
Fix file transfer
dhekra-rouatbi Aug 15, 2025
7c1f723
Fix file transfer
dhekra-rouatbi Aug 16, 2025
b7d5ccc
Fix file transfer
dhekra-rouatbi Aug 16, 2025
fb6c11a
Fix file transfer
dhekra-rouatbi Aug 17, 2025
04b029c
Fix file transfer : Avoid duplicated files
dhekra-rouatbi Aug 17, 2025
f96f8b0
Fix file transfer : Avoid duplicated files
dhekra-rouatbi Aug 17, 2025
7ecb2dd
Fix file transfer
dhekra-rouatbi Aug 18, 2025
f9e2cb0
update the run queue
dhekra-rouatbi Aug 19, 2025
d520ea9
generate qrImage in the view model
dhekra-rouatbi Aug 19, 2025
80aeea7
Add observeNetworkChanges to sender view
dhekra-rouatbi Aug 19, 2025
38d09c4
set preserve metadata to true
dhekra-rouatbi Aug 19, 2025
8a0f436
Fix file transfer
dhekra-rouatbi Aug 19, 2025
a0232d6
delete unused code
dhekra-rouatbi Aug 19, 2025
853275d
Remove the file extension adding in prepare upload
dhekra-rouatbi Aug 19, 2025
ee2b3f1
Refactor Receiving and encrypting files design
dhekra-rouatbi Aug 21, 2025
83e540a
Refactor Receiving and encrypting files design
dhekra-rouatbi Aug 21, 2025
fed2c33
Refactor Receiving and encrypting files design
dhekra-rouatbi Aug 21, 2025
20cfd3d
Refactor Receiving and encrypting files design
dhekra-rouatbi Aug 21, 2025
3e2c11f
Refactor Receiving and encrypting files design
dhekra-rouatbi Aug 21, 2025
0c6eec7
Add other custom errors strings and refactor the code to support that
dhekra-rouatbi Aug 27, 2025
08b5056
Remove redundant code
dhekra-rouatbi Aug 28, 2025
5164c96
Add Transfer Already Completed error
dhekra-rouatbi Aug 28, 2025
7b6392b
Remove the sha256 from NearbySharingFile
dhekra-rouatbi Aug 29, 2025
436b03b
Disable the listeners when the view disappear
dhekra-rouatbi Sep 3, 2025
c298b88
Clear the Temp Directory when the app will terminate
dhekra-rouatbi Sep 3, 2025
54fb73b
Fix: if Android cancel , you should not show "An error has occured" …
dhekra-rouatbi Sep 8, 2025
66a50b2
Update Wi-Fi screen design
dhekra-rouatbi Sep 9, 2025
36e5f49
Update Icon Text Button component
dhekra-rouatbi Sep 10, 2025
70588e2
update TipsToConnectButton title
dhekra-rouatbi Sep 10, 2025
9af81af
Update verification screen
dhekra-rouatbi Sep 12, 2025
052c25e
Update observers
dhekra-rouatbi Sep 12, 2025
00a21b9
Update verification screen
dhekra-rouatbi Sep 12, 2025
6af3cfa
Fix conflict
dhekra-rouatbi Jan 12, 2026
a6bdfe9
Fix conflict
dhekra-rouatbi Jan 12, 2026
bfa901f
Fix conflict
dhekra-rouatbi Jan 12, 2026
26da2c5
Fix conflict
dhekra-rouatbi Jan 12, 2026
f386743
Fix conflict
dhekra-rouatbi Jan 12, 2026
c9a5d9e
Fix conflict
dhekra-rouatbi Jan 12, 2026
7b72fe0
Fix conflict
dhekra-rouatbi Jan 12, 2026
321c1ee
Fix conflict
dhekra-rouatbi Jan 12, 2026
b5608ca
Fix conflict
dhekra-rouatbi Jan 12, 2026
3c78c55
Fix conflict
dhekra-rouatbi Jan 12, 2026
1ddc229
Fix conflict
dhekra-rouatbi Feb 2, 2026
24322d0
Fix conflict
dhekra-rouatbi Feb 2, 2026
61c4577
Fix conflict
dhekra-rouatbi Feb 2, 2026
17d96d9
Update "Get Started" flow
dhekra-rouatbi Feb 5, 2026
191476b
Update "Get Started" flow
dhekra-rouatbi Feb 5, 2026
7ad925b
Add nearby sharing to the onboarding
dhekra-rouatbi Feb 5, 2026
1669181
Update strings
dhekra-rouatbi Feb 5, 2026
25082ba
Delete duplicated string keys
dhekra-rouatbi Feb 5, 2026
c5e2145
Update strings
dhekra-rouatbi Feb 5, 2026
3a5a7c9
Fix Design inconsistencies
dhekra-rouatbi Feb 10, 2026
e839f66
Show the numeric keyboard when entering the IP
dhekra-rouatbi Feb 10, 2026
6b46a10
Update file size method
dhekra-rouatbi Mar 9, 2026
f33e2af
Add hash to vault file
dhekra-rouatbi Mar 12, 2026
8266c67
Add hash to vault file
dhekra-rouatbi Mar 12, 2026
d578b43
update sqlite3_column_type
dhekra-rouatbi Mar 12, 2026
786bc44
Check the hash when receive the file
dhekra-rouatbi Mar 12, 2026
930611a
Check the hash when receive the file
dhekra-rouatbi Mar 12, 2026
70be77c
Add missing nonces
dhekra-rouatbi Mar 12, 2026
1b7d94c
Add missing nonces
dhekra-rouatbi Mar 13, 2026
fa7a9bf
Add hash comparison and insufficient space
dhekra-rouatbi Mar 25, 2026
499a1a3
move beginUploadFromRequest to NearbySharingStateActor
dhekra-rouatbi Mar 26, 2026
8ccf291
Implement Nonce (no reuse): Server stores/checks nonces
dhekra-rouatbi Mar 27, 2026
59f95f3
Implement Nonce (no reuse): Server stores/checks nonces
dhekra-rouatbi Mar 27, 2026
93202fc
Implement Nonce (no reuse): Server stores/checks nonces
dhekra-rouatbi Mar 27, 2026
a1499af
Handle errors when receiving responses
dhekra-rouatbi Mar 29, 2026
755e927
update received file state after hash verification
dhekra-rouatbi Mar 30, 2026
fcfdeb1
Fix conflict
dhekra-rouatbi Mar 30, 2026
d765951
Fix conflict
dhekra-rouatbi Mar 30, 2026
644ec1f
Fix conflict
dhekra-rouatbi Mar 30, 2026
a19d15e
Fix conflict
dhekra-rouatbi Mar 30, 2026
fe708f1
Fix conflict
dhekra-rouatbi Mar 30, 2026
e435d0f
Fix conflict
dhekra-rouatbi Mar 30, 2026
17c0b00
Fix conflict
dhekra-rouatbi Mar 30, 2026
fd25e90
Fix conflict
dhekra-rouatbi Mar 30, 2026
0825c85
Implement Rate limiting
dhekra-rouatbi Mar 30, 2026
7cea71a
Implement Rate limiting
dhekra-rouatbi Mar 30, 2026
3159e86
Implement maximum file count and file size limits
dhekra-rouatbi Mar 31, 2026
5699693
Implement maximum file count and file size limits
dhekra-rouatbi Apr 1, 2026
2b0268c
Implement maximum file count and file size limits
dhekra-rouatbi Apr 1, 2026
c8add23
calculate the hash after modifying the file metadata
dhekra-rouatbi Apr 1, 2026
b80ff7e
Fix Insufficient Certificate Pinning
dhekra-rouatbi Apr 1, 2026
a59efc2
Change the ip address to a list of strings
dhekra-rouatbi Apr 2, 2026
4be74dd
Fix changes from background threads
dhekra-rouatbi Apr 6, 2026
bccdf51
Change the ip address to a list of strings
dhekra-rouatbi Apr 6, 2026
b2d4f39
Delete duplicated and unused classes
dhekra-rouatbi Apr 7, 2026
0bb0e12
Delete unused functions
dhekra-rouatbi Apr 7, 2026
19911c9
Improve deleting temp files
dhekra-rouatbi Apr 7, 2026
a266a14
Improve deleting temp files
dhekra-rouatbi Apr 7, 2026
a72d295
Remove decrypted Files Stored in Temporary Directory
dhekra-rouatbi Apr 8, 2026
84f0471
Delete senderCertificateHash
dhekra-rouatbi Apr 8, 2026
3bd929c
Build 3.0.0(131)
dhekra-rouatbi Apr 8, 2026
ce12f5e
update get ipAddresses function
dhekra-rouatbi Apr 8, 2026
9de7499
Centralise Nearby sharing URLSession
dhekra-rouatbi Apr 8, 2026
74dddd1
Build 3.0.0(132)
dhekra-rouatbi Apr 8, 2026
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
573 changes: 542 additions & 31 deletions Tella.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions Tella/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,29 @@ class AppDelegate: NSObject, UIApplicationDelegate {

var backgroundSessionCompletionHandler: (() -> Void)?
static private(set) var instance: AppDelegate! = nil

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
@Published var shouldHandleTimeout : Bool = false
@Published var appWillTerminate : Bool = false

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
AppDelegate.instance = self
setupDropbox()
configureGoogleSignIn()
return true
}

func application(_ application: UIApplication,
handleEventsForBackgroundURLSession identifier: String,
completionHandler: @escaping () -> Void) {
backgroundSessionCompletionHandler = completionHandler
func applicationWillTerminate(_ application: UIApplication) {
appWillTerminate = true
}

func application(
_ application: UIApplication,
handleEventsForBackgroundURLSession
handleEventsForBackgroundURLSessionidentifier: String,
completionHandler: @escaping () -> Void) {
backgroundSessionCompletionHandler = completionHandler
shouldHandleTimeout = true
}

private func setupDropbox() {
guard let dropboxAppKey = ConfigurationManager.getValue(DropboxAuthConstants.dropboxAppKey) else {
debugLog("Dropbox App Key not found")
Expand Down
8 changes: 0 additions & 8 deletions Tella/Application/AppViewState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ final class AppViewState: ObservableObject {
return viewStack.last ?? .LOCK
}

func navigateBack() {
viewStack.removeLast()
}

func navigate(to view: MainViewEnum) {
viewStack.append(view)
}

func resetToLock() {
viewStack = [.LOCK]
}
Expand Down
8 changes: 8 additions & 0 deletions Tella/Application/TellaApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ struct TellaApp: App {
if UIApplication.shared.applicationState == .background {
self.saveData(lockAppType: .finishBackgroundTasks)
}
}.onReceive(appDelegate.$appWillTerminate) { willTerminate in
if willTerminate {
clearTmpDirectory()
}
}

}.onChange(of: scenePhase) { phase in
Expand Down Expand Up @@ -89,4 +93,8 @@ struct TellaApp: App {
appViewState.homeViewModel.appEnterInBackground = false
appViewState.homeViewModel.shouldShowSecurityScreen = false
}

func clearTmpDirectory() {
appViewState.homeViewModel.vaultManager.clearTmpDirectory()
}
}
48 changes: 0 additions & 48 deletions Tella/BundleInfo.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//
// AddFileBottomSheetView.swift
// Tella
//
// Created by RIMA on 26.02.25.
// Copyright © 2025 HORIZONTAL.
// Licensed under MIT (https://github.com/Horizontal-org/Tella-iOS/blob/develop/LICENSE)
//

import SwiftUI

struct AddFileBottomSheetView<Content: View>: View {

@ObservedObject var viewModel: AddFilesViewModel
@EnvironmentObject var sheetManager: SheetManager
var content: () -> Content
var moreAction: (() -> ())? = nil

init(viewModel: AddFilesViewModel, content: @escaping () -> Content, moreAction: (() -> ())? = nil ) {
self.viewModel = viewModel
self.content = content
self.moreAction = moreAction
}
var body: some View {
Button {
UIApplication.shared.endEditing()
moreAction?()
showAddFileSheet()
} label: {
content()
}
}

func showAddFileSheet() {
sheetManager.showBottomSheet(content: {
ActionListBottomSheet(items: viewModel.bottomSheetItems,
headerTitle: LocalizableVault.manageFilesSheetTitle.localized,
action: { item in
self.handleActions(item: item)
})
})
}

private func handleActions(item: ListActionSheetItem) {
guard let type = item.type as? ManageFileType else { return }

switch type {
case .camera:
viewModel.showingCamera = true

case .recorder:
viewModel.showingRecordView = true

case .fromDevice:
showAddPhotoVideoSheet()

case .tellaFile:
navigateTo(destination: fileListView)

default:
break
}
sheetManager.hide()
}

func showAddPhotoVideoSheet() {
viewModel.showingImagePicker = true
}

var fileListView: some View {
FileListView(mainAppModel: viewModel.mainAppModel,
filterType: viewModel.shouldShowDocumentsOnly ? .documents : .audioPhotoVideo,
title: LocalizableReport.selectFiles.localized,
fileListType: .selectFiles,
resultFile: $viewModel.resultFile)
}
}
24 changes: 24 additions & 0 deletions Tella/Components/AddFileGridViewComponent/AddFileCameraView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AddFileCameraView.swift
// Tella
//
// Created by RIMA on 26.02.25.
// Copyright © 2025 HORIZONTAL.
// Licensed under MIT (https://github.com/Horizontal-org/Tella-iOS/blob/develop/LICENSE)
//

import SwiftUI
struct AddFileCameraView: View {
@ObservedObject var viewModel: AddFilesViewModel

var sourceView = SourceView.addFile

var body: some View {
viewModel.showingCamera ?
CameraView(sourceView: sourceView,
showingCameraView: $viewModel.showingCamera,
resultFile: $viewModel.resultFile,
mainAppModel: viewModel.mainAppModel) : nil
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// AddFileGridItemView.swift
// Tella
//
// Created by RIMA on 26.02.25.
// Copyright © 2025 HORIZONTAL.
// Licensed under MIT (https://github.com/Horizontal-org/Tella-iOS/blob/develop/LICENSE)
//

import SwiftUI

struct AddFileGridItemView: View {

var file: VaultFileDB

@StateObject var viewModel: AddFilesViewModel

var body: some View {
gridItemView
.overlay(deleteButton, alignment: .topTrailing)
}

var gridItemView : some View {
ZStack {
file.gridImage
self.fileNameText
}
}

var deleteButton : some View {
Button {
viewModel.deleteFile(fileId: file.id)
} label: {
Image("delete.cross.icon")
.padding(.all, 10)
}
}

@ViewBuilder
var fileNameText: some View {

if self.file.tellaFileType != .image || self.file.tellaFileType != .video {
VStack {
Spacer()
CustomText(self.file.name,
style: .body3Style)
.lineLimit(1)
Spacer()
.frame(height: 6)
}.padding(EdgeInsets(top: 0, leading: 5, bottom: 0, trailing: 5))
}
}
}

50 changes: 50 additions & 0 deletions Tella/Components/AddFileGridViewComponent/AddFileGridView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// AddFileGridView.swift
// Tella
//
// Created by RIMA on 26.02.25.
// Copyright © 2025 HORIZONTAL.
// Licensed under MIT (https://github.com/Horizontal-org/Tella-iOS/blob/develop/LICENSE)
//

import SwiftUI

struct AddFileGridView: View {

private let gridLayout: [GridItem] = [GridItem(spacing: 12),
GridItem(spacing: 12),
GridItem(spacing: 12)]

private let gridItemHeight = (UIScreen.screenWidth - 64.0) / 3

@ObservedObject var viewModel: AddFilesViewModel

var titleText: String

var body: some View {
VStack(alignment: .leading, spacing: 12) {

attachFilesTextView

itemsGridView

AddFileBottomSheetView(viewModel: viewModel) {
Image("add.file.icon")
}
}
}


var attachFilesTextView: some View {
CustomText(titleText, style: .body1Style)
}

var itemsGridView: some View {
LazyVGrid(columns: gridLayout, alignment: .center, spacing: 12) {
ForEach(viewModel.files.sorted{$0.created < $1.created}, id: \.id) { file in
AddFileGridItemView(file: file, viewModel: viewModel)
.frame(height: gridItemHeight)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// AddFilePhotoVideoPickerView.swift
// Tella
//
// Created by RIMA on 26.02.25.
// Copyright © 2025 HORIZONTAL.
// Licensed under MIT (https://github.com/Horizontal-org/Tella-iOS/blob/develop/LICENSE)
//

import SwiftUI

struct AddFilePhotoVideoPickerView: View {

@ObservedObject var viewModel: AddFilesViewModel

var body: some View {
PhotoVideoPickerView(showingImagePicker: $viewModel.showingImagePicker,
showingImportDocumentPicker: $viewModel.showingImportDocumentPicker,
mainAppModel: viewModel.mainAppModel,
resultFile: $viewModel.resultFile)

}
}
23 changes: 23 additions & 0 deletions Tella/Components/AddFileGridViewComponent/AddFileRecordView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// AddFileRecordView.swift
// Tella
//
// Created by RIMA on 26.02.25.
// Copyright © 2025 HORIZONTAL.
// Licensed under MIT (https://github.com/Horizontal-org/Tella-iOS/blob/develop/LICENSE)
//

import SwiftUI
struct AddFileRecordView: View {

@ObservedObject var viewModel: AddFilesViewModel

var body: some View {
viewModel.showingRecordView ?
RecordView(mainAppModel: viewModel.mainAppModel,
sourceView: .addReportFile,
showingRecoredrView: $viewModel.showingRecordView,
resultFile: $viewModel.resultFile) : nil

}
}
Loading