fix(ags): fix remove function not working

This commit is contained in:
matt1432 2023-11-04 23:09:09 -04:00
parent c604f8fa72
commit fe445a0ccc
3 changed files with 4 additions and 6 deletions

View file

@ -12,11 +12,6 @@ import Overview from './js/overview/main.js';
import AppLauncher from './js/applauncher/main.js';
import * as Corners from './js/screen-corners.js';
// Has to be a traditional function for 'this' scope
// Keep this here for no errors
Array.prototype.removeItem = function (el) { this.splice(this.indexOf(el), 1); };
const scss = App.configDir + '/scss/main.scss';
const css = App.configDir + '/style.css';
exec(`sassc ${scss} ${css}`);

View file

@ -139,7 +139,7 @@ export const Notification = ({
notifWidget.child.setStyle(notifWidget.child[`_squeeze${side}`]);
timeout(500, () => {
HasNotifs.value = Notifications.notifications.length > 0;
notifWidget.get_parent().removeItem(notifWidget);
notifWidget.get_parent().remove(notifWidget);
notifWidget.destroy();
});
});

View file

@ -1,3 +1,6 @@
// Has to be a traditional function for 'this' scope
Array.prototype.removeItem = function (el) { this.splice(this.indexOf(el), 1); };
import App from 'resource:///com/github/Aylur/ags/app.js';
import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
import { Icon, Revealer } from 'resource:///com/github/Aylur/ags/widget.js';