diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js index a704cb3e7..56a5aec05 100644 --- a/js/ui/endSessionDialog.js +++ b/js/ui/endSessionDialog.js @@ -223,14 +223,7 @@ function _setCheckBoxLabel(checkBox, text) { } } -export function init() { - // This always returns the same singleton object - // By instantiating it initially, we register the - // bus object, etc. - new EndSessionDialog(); -} - -const EndSessionDialog = GObject.registerClass( +export const EndSessionDialog = GObject.registerClass( class EndSessionDialog extends ModalDialog.ModalDialog { _init() { super._init({ diff --git a/js/ui/main.js b/js/ui/main.js index 9e14bc141..ad6d3d611 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -90,6 +90,7 @@ export let kbdA11yDialog = null; export let inputMethod = null; export let introspectService = null; export let locatePointer = null; +export let endSessionDialog = null; let _startDate; let _defaultCssStylesheet = null; @@ -275,7 +276,7 @@ async function _initializeUI() { // Provide the bus object for gnome-session to // initiate logouts. - EndSessionDialog.init(); + endSessionDialog = new EndSessionDialog.EndSessionDialog(); // We're ready for the session manager to move to the next phase GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {