mirror of
https://github.com/edu4rdshl/Strata.git
synced 2026-07-18 07:34:45 +00:00
fix: use ESM import for MessageTray in _notifyDaemonMissing
The extension uses ESM modules (GNOME 45+). The old imports.* global does not exist in that context, causing a silent ReferenceError when the strata-daemon binary is not found -- the user never saw the notification. Replace with a proper import statement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
350d647953
commit
86351cb22c
1 changed files with 4 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import St from 'gi://St';
|
|||
|
||||
import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js';
|
||||
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
|
||||
|
||||
import { StrataProxy, BUS_NAME, OBJECT_PATH } from './dbus.js';
|
||||
|
|
@ -299,16 +300,16 @@ export default class StrataExtension extends Extension {
|
|||
|
||||
_notifyDaemonMissing() {
|
||||
try {
|
||||
const source = new imports.ui.messageTray.Source({
|
||||
const source = new MessageTray.Source({
|
||||
title: 'Strata',
|
||||
icon: new St.Icon({ icon_name: 'edit-paste-symbolic' }),
|
||||
});
|
||||
Main.messageTray.add(source);
|
||||
const notification = new imports.ui.messageTray.Notification({
|
||||
const notification = new MessageTray.Notification({
|
||||
source,
|
||||
title: 'Strata: daemon not found',
|
||||
body: 'Install the strata-daemon package to enable clipboard history.',
|
||||
urgency: imports.ui.messageTray.Urgency.HIGH,
|
||||
urgency: MessageTray.Urgency.HIGH,
|
||||
});
|
||||
source.addNotification(notification);
|
||||
} catch (_) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue