Skip to content

Commit

Permalink
appIcons: Drop code that is not used anymore by any supported version
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Aug 24, 2024
1 parent 4faeb78 commit 87d64da
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions appIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {
ParentalControlsManager,
} from './dependencies/shell/misc.js';

import {Config} from './dependencies/shell/misc.js';

import {
AppIconIndicators,
DBusMenuUtils,
Expand Down Expand Up @@ -1177,20 +1175,14 @@ const DockAppIconMenu = class DockAppIconMenu extends PopupMenu.PopupMenu {
this._appendSeparator();

const isFavorite = AppFavorites.getAppFavorites().isFavorite(app.get_id());
const [majorVersion] = Config.PACKAGE_VERSION.split('.');

if (isFavorite) {
const label = majorVersion >= 42 ? _('Unpin')
: _('Remove from Favorites');
const item = this._appendMenuItem(label);
const item = this._appendMenuItem(_('Unpin'));
item.connect('activate', () => {
const favs = AppFavorites.getAppFavorites();
favs.removeFavorite(app.get_id());
});
} else {
const label = majorVersion >= 42 ? _('Pin to Dock')
: _('Add to Favorites');
const item = this._appendMenuItem(label);
const item = this._appendMenuItem(_('Pin to Dock'));
item.connect('activate', () => {
const favs = AppFavorites.getAppFavorites();
favs.addFavorite(app.get_id());
Expand Down

0 comments on commit 87d64da

Please sign in to comment.