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

feat(sync): set device name with random string at the end #121

Merged
merged 4 commits into from
May 10, 2019

Conversation

okdistribute
Copy link
Contributor

No description provided.

constructor (props) {
super(props)
// recreate this as little as possible
this._deviceName = this._deviceName || "Android " + crypto.randomBytes(2).toString('hex').slice(0, 3);
Copy link
Contributor Author

@okdistribute okdistribute May 9, 2019

Choose a reason for hiding this comment

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

This is intended to make sure the device name doesn't change every time you open/close sync, not sure if this is the best way to do it

Copy link
Member

Choose a reason for hiding this comment

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

I switched to generate this once during the lifecycle of the app
FYI whenever the constructor is called, this._deviceName would always be undefined, since it's only called when creating a new instance.

<TouchableNativeFeedback onPress={onPress}>
<View style={styles.wifiBar}>
<WifiIcon />
<Text style={styles.wifiBarText}>
<Text style={styles.bold}>Wi-Fi:</Text> {ssid}
<Text style={styles.bold}>Wi-Fi:</Text> {ssid}, {deviceName}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

how do we want to display the device name?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good place to put it. Just tweaked formatting

@gmaclennan gmaclennan merged commit 3c005a9 into master May 10, 2019
@gmaclennan gmaclennan deleted the device-name branch May 10, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants