mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
messageTray: Add source policy setter
Commit 8f15193b4 changed the `policy` property from a regular JS property to
a getter. This was necessary to avoid calling an overridden _createPolicy()
method before a subclass is properly initialized, but it broke the second
way of using notification sources:
Don't create a Source subclass, but use the base class directly and change
its `policy` property.
There's no good reason why we should no longer allow this, so add a setter.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/431
This commit is contained in:
parent
510b060947
commit
1c9d821aa2
1 changed files with 6 additions and 0 deletions
|
|
@ -708,6 +708,12 @@ var Source = class Source {
|
|||
return this._policy;
|
||||
}
|
||||
|
||||
set policy(policy) {
|
||||
if (this._policy)
|
||||
this._policy.destroy();
|
||||
this._policy = policy;
|
||||
}
|
||||
|
||||
get count() {
|
||||
return this.notifications.length;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue