Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #1488: Changing Private Browsing Only, adjusts theme correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhreis committed Sep 6, 2019
1 parent cc80f41 commit b0ee471
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Client/Frontend/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,24 @@ class SettingsViewController: TableViewController {
}
})
]
privacy.rows.append(BoolRow(title: Strings.Private_Browsing_Only, option: Preferences.Privacy.privateBrowsingOnly))
privacy.rows.append(
BoolRow(
title: Strings.Private_Browsing_Only,
option: Preferences.Privacy.privateBrowsingOnly,
onValueChange: {
Preferences.Privacy.privateBrowsingOnly.value = $0

// Need to flush the table, hacky, but works consistenly and well
let superView = self.tableView.superview
self.tableView.removeFromSuperview()
DispatchQueue.main.async {
// Let shield toggle change propagate, otherwise theme may not be set properly
superView?.addSubview(self.tableView)
self.applyTheme(self.theme)
}
}
)
)
return privacy
}()

Expand Down

0 comments on commit b0ee471

Please sign in to comment.