[cr145] Fix warnings about redefining computed properties in delete browsing data dialog
As upstream continues to work on rearchitecting the delete browsing data dialog, we encountered the following warnings when visiting the dialog in cr145: polymer_bundled.min.js:1 Cannot redefine computed property 'isSyncPaused_'. polymer_bundled.min.js:1 Cannot redefine computed property 'hasPassphraseError_'. polymer_bundled.min.js:1 Cannot redefine computed property 'hasOtherSyncError_'. polymer_bundled.min.js:1 Cannot redefine computed property 'googleSearchHistoryString_'. This is because we override `properties()` using a spread of the base class properties, which ends up redefining them. Remove the spread of base class properties and initialize Brave-specific fields in the constructor instead. This avoids redeclaring inherited computed properties, which caused runtime Polymer errors, while keeping TypeScript type checking happy. The change ensures new instance properties are added safely without breaking inherited behavior.
This commit is contained in:
+6
-12
@@ -35,18 +35,12 @@ extends SettingsClearBrowsingDataDialogElement {
|
||||
|
||||
private saveOnExitSettingsCallback_: (() => void) | null = null
|
||||
|
||||
static override get properties() {
|
||||
return {
|
||||
...SettingsClearBrowsingDataDialogElement.properties,
|
||||
braveRewardsEnabled_: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
},
|
||||
onClearBraveAdsDataClickHandler_: {
|
||||
type: Function,
|
||||
value: () => {},
|
||||
},
|
||||
}
|
||||
constructor() {
|
||||
super()
|
||||
|
||||
// Initialize new properties
|
||||
this.braveRewardsEnabled_ = false
|
||||
this.onClearBraveAdsDataClickHandler_ = () => {}
|
||||
}
|
||||
|
||||
override ready() {
|
||||
|
||||
Reference in New Issue
Block a user