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

Initial Electron Settings - for Auto Launch #920

Merged
merged 6 commits into from May 30, 2017
Merged

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented May 24, 2017

added .isElectron() to make the detection of electron more readable

(opens path for Proxy Settings)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@matrixbot
Copy link
Member

Can one of the admins verify this patch?

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
return "Not implemented";
}

isElectron(): boolean { return false; }
Copy link
Member

Choose a reason for hiding this comment

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

this feels a bit weird to pollute BasePlatform with knowledge of electron - could we not just check the type of PlatformPeg to see if it's a VectorBasePlatform or not?

Copy link
Member Author

Choose a reason for hiding this comment

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

how do you mean? I can't do PlatformPeg.get() instanceof ElectronPlatform from the react-sdk side of things. How about a generic getFlags() method on BasePlatform and descendants that would have a prop of isElectron = true on Electron Platform, no idea what else it'd be useful for but it seems like the most generic way of solving this

Copy link
Member Author

Choose a reason for hiding this comment

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

or since now they have getHumanReadableName could do it based off of that but that feels dirty

Copy link
Member Author

Choose a reason for hiding this comment

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

it could also just be a property and then accessed as PlatformPeg.get().isElectron
that way no other classes have to implement it but is also weird, I guess its all weird with the current settings architecture

Copy link
Member

Choose a reason for hiding this comment

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

i must be missing how instanceof works - why wouldn't it work from the react-sdk side?

Copy link
Member Author

Choose a reason for hiding this comment

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

how would I import ElectronPlatform from riot-web into react-sdk so I can refer to it in an instanceof? Am I missing something obvious :/?

Copy link
Member

Choose a reason for hiding this comment

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

only by violating the layering (which already happens in a bunch of places, sadly). for now, stick with the isElectron() method.

@ara4n
Copy link
Member

ara4n commented May 26, 2017

lgtm other than query

@t3chguy t3chguy changed the base branch from develop to t3chguy/electron_call_sleep May 29, 2017 21:29
@t3chguy t3chguy changed the base branch from t3chguy/electron_call_sleep to develop May 29, 2017 21:29
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@t3chguy t3chguy force-pushed the t3chguy/electron_settings branch from ed57a37 to 7e02977 Compare May 29, 2017 21:32
@ara4n ara4n added the X-Release-Blocker This affects the current release cycle and must be solved for a release to happen label May 30, 2017
const {ipcRenderer} = require('electron');

return <div>
<h3>Electron Settings</h3>
Copy link
Member

Choose a reason for hiding this comment

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

Users don't know what electron is. "Desktop-specific settings" perhaps?

@ara4n
Copy link
Member

ara4n commented May 30, 2017

lgtm other than merge conflicts and the comedy setting label problem

@ara4n
Copy link
Member

ara4n commented May 30, 2017

(oh, and please can haz i18n)

@t3chguy
Copy link
Member Author

t3chguy commented May 30, 2017

oh hah, I half i18n'd it

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
… t3chguy/electron_settings

# Conflicts:
#	src/components/structures/UserSettings.js
#	src/i18n/strings/en_EN.json

First time using JetBrains Merge Tool, MAY HAVE GONE HORRIBLY WRONG

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
@ara4n
Copy link
Member

ara4n commented May 30, 2017

lgtm

@ara4n ara4n merged commit 3942dbc into develop May 30, 2017
@t3chguy t3chguy deleted the t3chguy/electron_settings branch October 29, 2017 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X-Release-Blocker This affects the current release cycle and must be solved for a release to happen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants