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 19, 2017
1 parent fab48e2 commit 6b1ab82
Show file tree
Hide file tree
Showing 4 changed files with 312 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 6b1ab82

Please sign in to comment.