Skip to content

Commit

Permalink
Remove unneeded brand flags
Browse files Browse the repository at this point in the history
Signed-off-by: Milen Pivchev <[email protected]>
  • Loading branch information
mpivchev committed Jun 12, 2024
1 parent e87f4a1 commit b01a8bb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
14 changes: 0 additions & 14 deletions Brand/NCBrand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ let userAgent: String = {
@objc public var sourceCode: String = "https://github.com/nextcloud/ios"
@objc public var mobileconfig: String = "/remote.php/dav/provisioning/apple-provisioning.mobileconfig"

// Personalized
@objc public var webCloseViewProtocolPersonalized: String = "" // example "abc://change/plan" Don't touch me !!
@objc public var folderBrandAutoUpload: String = "" // example "_auto_upload_folder_" Don't touch me !!

// Auto Upload default folder
@objc public var folderDefaultAutoUpload: String = "Photos"

Expand All @@ -59,15 +55,10 @@ let userAgent: String = {
@objc public var capabilitiesGroupApps: String = "group.com.nextcloud.apps"

// BRAND ONLY
@objc public var use_login_web_personalized: Bool = false // Don't touch me !!
@objc public var use_AppConfig: Bool = false // Don't touch me !!
@objc public var use_GroupApps: Bool = true // Don't touch me !!

// Options
@objc public var use_default_auto_upload: Bool = false
@objc public var use_themingColor: Bool = true
@objc public var use_themingLogo: Bool = false
@objc public var use_storeLocalAutoUploadAll: Bool = false

@objc public var disable_intro: Bool = false
@objc public var disable_request_login_url: Bool = false
Expand Down Expand Up @@ -98,11 +89,6 @@ let userAgent: String = {
}

override init() {

if folderBrandAutoUpload != "" {
folderDefaultAutoUpload = folderBrandAutoUpload
}

// wrapper AppConfig
if let configurationManaged = UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed"), use_AppConfig {

Expand Down
2 changes: 1 addition & 1 deletion iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}

// [WEBPersonalized] [AppConfig]
if NCBrandOptions.shared.use_login_web_personalized || NCBrandOptions.shared.use_AppConfig {
if NCBrandOptions.shared.use_AppConfig {
if activeLogin?.view.window == nil {
urlBase = NCBrandOptions.shared.loginBaseUrl
pollLogin()
Expand Down
16 changes: 8 additions & 8 deletions iOSClient/Data/NCManageDatabase+Account.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ extension NCManageDatabase {

addObject.account = account

// Brand
if NCBrandOptions.shared.use_default_auto_upload {

addObject.autoUpload = true
addObject.autoUploadImage = true
addObject.autoUploadVideo = true
addObject.autoUploadWWAnVideo = true
}
// // Brand
// if NCBrandOptions.shared.use_default_auto_upload {
//
// addObject.autoUpload = true
// addObject.autoUploadImage = true
// addObject.autoUploadVideo = true
// addObject.autoUploadWWAnVideo = true
// }

NCKeychain().setPassword(account: account, password: password)

Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Login/NCLogin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
navigationItem.leftBarButtonItem = navigationItemCancel
}

if NCBrandOptions.shared.use_GroupApps, let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) {
if let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) {
// Nextcloud update share accounts
if let error = appDelegate.updateShareAccounts() {
NextcloudKit.shared.nkCommonInstance.writeLog("[ERROR] Create share accounts \(error.localizedDescription)")
Expand Down
6 changes: 3 additions & 3 deletions iOSClient/Login/NCLoginPoll.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct NCLoginPoll: View {

var body: some View {
VStack {
Text("Please complete the log in process your browser")
Text(NSLocalizedString("_poll_desc_", comment: ""))
.multilineTextAlignment(.center)
.foregroundStyle(.white)
.padding()
Expand All @@ -32,14 +32,14 @@ struct NCLoginPoll: View {
.padding()

HStack {
Button("Cancel") {
Button(NSLocalizedString("_cancel_", comment: "")) {
dismiss()
}
.disabled(loginManager.isLoading || cancelButtonDisabled)
.buttonStyle(.bordered)
.tint(.white)

Button("Retry") {
Button(NSLocalizedString("_retry_", comment: "")) {
loginManager.openLoginInBrowser()
}
.buttonStyle(.borderedProminent)
Expand Down
5 changes: 4 additions & 1 deletion iOSClient/Supporting Files/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@
"_disabled_" = "Disabled";
"_standard_" = "Standard";
"_maximum_" = "Maximum";
"_error_occurred_" = "An error occurred, please try again";
"_error_occurred_" = "An error occurred, please try again";
"_retry_" = "Retry";

/* MARK: Files lock */

Expand Down Expand Up @@ -1075,3 +1076,5 @@
"_no_types_" = "No provider found";
"_no_types_subtitle_" = "AI Providers need to be installed to use the Assistant";

// MARK: Login poll
"_poll_desc_" = "Please complete the log in process your browser";

0 comments on commit b01a8bb

Please sign in to comment.