Skip to content
Open
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
18 changes: 18 additions & 0 deletions Share/NCShareExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class NCShareExtension: UIViewController {
var progress: CGFloat = 0
var counterUploaded: Int = 0
var uploadMetadata: [tableMetadata] = []
let hud = NCHud()
let utilityFileSystem = NCUtilityFileSystem()
let utility = NCUtility()
let global = NCGlobal.shared
Expand All @@ -53,6 +54,20 @@ class NCShareExtension: UIViewController {
var banner: LucidBanner?
var sceneIdentifier: String = UUID().uuidString

let database = NCManageDatabase.shared
var account: String = ""
var session: NCSession.Session {
if !account.isEmpty,
let tableAccount = self.database.getTableAccount(account: account) {
return NCSession.Session(account: tableAccount.account, urlBase: tableAccount.urlBase, user: tableAccount.user, userId: tableAccount.userId)
} else if let activeTableAccount = self.database.getActiveTableAccount() {
self.account = activeTableAccount.account
return NCSession.Session(account: activeTableAccount.account, urlBase: activeTableAccount.urlBase, user: activeTableAccount.user, userId: activeTableAccount.userId)
} else {
return NCSession.Session(account: "", urlBase: "", user: "", userId: "")
}
}

// MARK: - View Life Cycle

override func viewDidLoad() {
Expand Down Expand Up @@ -127,6 +142,9 @@ class NCShareExtension: UIViewController {
if let windowScene = view.window?.windowScene {
banner = LucidBannerRegistry.shared.banner(for: windowScene)
}
NCImageCache.shared.createImagesCache()

NotificationCenter.default.addObserver(self, selector: #selector(didCreateFolder(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterCreateFolder), object: nil)
}

override func viewWillAppear(_ animated: Bool) {
Expand Down
Loading