Skip to content

Make the config optional#1612

Merged
richvdh merged 7 commits intodevelopfrom
dbkr/optional_config
Jun 9, 2016
Merged

Make the config optional#1612
richvdh merged 7 commits intodevelopfrom
dbkr/optional_config

Conversation

@dbkr
Copy link
Copy Markdown
Member

@dbkr dbkr commented Jun 8, 2016

Accept 404 errors from getting the config and start MatrixChat with no config, make other errors display a simple error message to prevent a completely blank page if the config does fail to load.

This allows us to move config.json to config.sample.json and not version config.json so people don't keep accidentally committing changes to config.json ;) (and vector will still work out of the box the same as it always has).

Accept 404 errors from getting the config and start MatrixChat with no config, make other errors display a simple error message to prevent a completely blank page if the config does fail to load.
if (this.props.brand) {
data['brand'] = this.props.brand;
} else if (this.props.brand === undefined) {
data['brand'] = 'Vector';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

data['brand'] = this.props.brand || 'Vector' would probably be better here

@richvdh richvdh assigned dbkr and unassigned richvdh Jun 8, 2016
@dbkr
Copy link
Copy Markdown
Member Author

dbkr commented Jun 9, 2016

done, ptal

@dbkr dbkr assigned richvdh and unassigned dbkr Jun 9, 2016
@@ -120,9 +120,7 @@ module.exports = React.createClass({
if (event.target.checked) {
var data = {}
if (this.props.brand) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this still doesn't look right. Lose this condition?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gah, thank you.

@richvdh richvdh assigned dbkr and unassigned richvdh Jun 9, 2016
@dbkr dbkr assigned richvdh and unassigned dbkr Jun 9, 2016
Comment thread src/vector/index.js Outdated
// On 404 errors, carry on without a config,
// but on other errors, fail, otherwise it will
// lead to subtle errors where the app runs with
// the default config if fails to fetch config.json.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/still/ has a typo: s/if/if it/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(fixed)

Fix dave's typo for him
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