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

Enabling nodeIntegration + Electron 27 #367

Merged
merged 8 commits into from
Apr 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
code cleanup
viktor44 committed Apr 27, 2024
commit 5c81192f7213360d1ee96e79923f01be29a1e5b3
Original file line number Diff line number Diff line change
@@ -225,10 +225,6 @@ export default class MultiInstanceConfigurator extends React.Component<Props, St
return this.renderOnPremiseForm({ normalFlow: true });
}


console.log('XXXXXX', selectedPreset);


switch (selectedPreset) {
case GoogleAccountPreset: return this.renderIdentityForm(); // google-account
case SubdomainPreset: return this.renderSubdomainForm(); // subdomain
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ import { Button, Size, Style } from '@getstation/theme';
import * as React from 'react';
// @ts-ignore: no declaration file
import injectSheet from 'react-jss';
// import { Subscription } from 'rxjs';
import { identitiesStyle, IdentitiesStylesType } from './styles';

export interface Props {
@@ -29,8 +28,6 @@ export default class ChooseIdentityForm extends React.PureComponent<Props, State
help: 'Choose an account',
};

// private subscription: Subscription;

constructor(props: Props) {
super(props);
this.state = {
@@ -54,12 +51,6 @@ export default class ChooseIdentityForm extends React.PureComponent<Props, State
identities,
});
});

// this.subscription = window.bx.identities.$get.subscribe(identities => {
// this.setState({
// identities,
// });
// });
}

//vk: FIXME: should we remove listener? how?
Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@ window.bx.theme.addThemeColorsChangeListener(
(_: any, result: any) => themeColorsObservable.next(result)
);

// const themeColorsObservable = window.bx.theme.themeColors;

ReactDOM.render(
<BrowserXThemeProvider>
<WebUIGradientProvider themeColorsObservable={themeColorsObservable}>
18 changes: 18 additions & 0 deletions packages/app/src/plugins/injected-js/whatsappInjectedScript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

//vk: moved from whatsappPreload.js

let snoozed = false;
const originalPlay = Audio.prototype.play;

const shouldBypassSnooze = (audio) => audio.src.startsWith('blob:http');

Audio.prototype.play = function() {
if (!snoozed || shouldBypassSnooze(this)) {
return originalPlay.call(this);
}
return Promise.resolve();
};

window.bx.notificationCenter.addSnoozeDurationInMsChangeListener((_, duration) => {
snoozed = Boolean(duration);
});
3 changes: 0 additions & 3 deletions packages/appstore/src/app.tsx
Original file line number Diff line number Diff line change
@@ -62,9 +62,6 @@ class AppImpl extends React.Component<Props, IState> {
// @ts-ignore : bx attached to window
const bxApi = window.bx;

// bxApi.theme.themeColors.subscribe((themeColors: string[]) =>
// this.setState({ themeColors }));

bxApi.theme.addThemeColorsChangeListener((_: any, themeColors: string[]) => {
this.setState({ themeColors })
});