Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove windowManager from extension api #1323

Merged
merged 10 commits into from
Nov 11, 2020

Conversation

jakolehm
Copy link
Contributor

Fixes #1320

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
@jakolehm jakolehm added bug Something isn't working area/extension Something to related to the extension api labels Nov 11, 2020
@jakolehm jakolehm added this to the 4.0.0 milestone Nov 11, 2020
@jakolehm jakolehm requested review from ixrock and a team November 11, 2020 09:44
Copy link
Contributor

@ixrock ixrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -16,7 +16,7 @@ import { isDevelopment } from "../common/vars";
export let tray: Tray;

// refresh icon when MacOS dark/light theme has changed
nativeTheme.on("updated", () => tray?.setImage(getTrayIcon()));
nativeTheme?.on("updated", () => tray?.setImage(getTrayIcon()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nativeTheme not available in some OS-es?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that windowManager is exposed to both main/renderer this needs to be protected, nativeTheme is undefined in renderer :/

Copy link
Contributor

@ixrock ixrock Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then probably better to move this binding to initTray(windowManager: WindowManager)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
….com:lensapp/lens into fix/remove-window-manager-from-extension-api

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

export class LensMainExtension extends LensExtension {
@observable.shallow appMenus: MenuRegistration[] = []

async navigate(location: string, frameId?: number) {
await WindowManager.getInstance<WindowManager>().navigate(location, frameId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whew, nice

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This reverts commit 03b486e.

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
@jakolehm jakolehm merged commit 00be4aa into master Nov 11, 2020
@jakolehm jakolehm deleted the fix/remove-window-manager-from-extension-api branch November 11, 2020 19:55
pauljwil pushed a commit to pauljwil/lens that referenced this pull request Nov 11, 2020
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
@jakolehm jakolehm mentioned this pull request Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/extension Something to related to the extension api bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WindowManager should not be exposed via extension-api
3 participants