Skip to content

Commit

Permalink
Converts BraveryPanel into redux component
Browse files Browse the repository at this point in the history
Resolves brave#9454

Auditors: @bsclifton @bridiver

Test Plan:
  • Loading branch information
NejcZdovc committed Jun 14, 2017
1 parent 915e13e commit 96abf66
Show file tree
Hide file tree
Showing 3 changed files with 265 additions and 250 deletions.
34 changes: 34 additions & 0 deletions app/common/lib/braveryPanelUtil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const Immutable = require('immutable')

// Utils
const urlParse = require('../urlParse')

const getDisplayHost = (lastCommittedURL) => {
const parsedUrl = urlParse(lastCommittedURL)
if (parsedUrl.protocol === 'https:' || parsedUrl.protocol === 'http:') {
return parsedUrl.host
}

return lastCommittedURL
}

const getRedirectedResources = (redirectedResources) => {
let result = new Immutable.List()
if (redirectedResources) {
redirectedResources.forEach((urls) => {
urls.forEach((url) => {
result = result.push(url)
})
})
}
return result
}

module.exports = {
getDisplayHost,
getRedirectedResources
}
Loading

0 comments on commit 96abf66

Please sign in to comment.